{block name=pages_product}
    {$message}
    <div id="product" class="detail">
        <div class="pinfo row{if $flag_has_specials == 1} special-price{/if}{if $date_available!=''} available-soon{/if}" itemprop="product" itemscope itemtype="http://schema.org/Product">
            <div class="col col-sm-7 col-md-8">
                <div class="lightgallery product-images row" itemscope itemtype="http://schema.org/ImageGallery">
                    <div class="col{if !$more_images || $more_images|@count == 0} col-sm-12{else} col-md-10 col-md-push-2{/if}">
                        <div class="image product-image center">
                            {if !$products_image || $products_image == 'product:noimage.gif'}
                                <span class="vertical-helper image-link no-image img-thumbnail img-label-wrap">
                                    <i class="no-image-icon"></i>
                                    {block name=pages_product_productImage_noImage_include_productInfoLabel}
                                        {include file="includes/product_info_label.html" position="product-page" isSpecial=$flag_has_specials dateAvailable=$date_available}
                                    {/block}
	                                {hook key=tpl_product_no_img module_data=$product}
                                </span>
                            {else}
                                <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
                                    <a href="{img img=$products_image type=m_org path_only=true}" itemprop="contentUrl" class="image-link cursor-zoom" data-type="main">
                                        <span class="img-thumbnail img-label-wrap">
                                            <img src="{img img=$products_image type=m_info path_only=true}" alt="{$products_name|escape:'html'}" itemprop="thumbnail" class="img-responsive image-link">
                                            {block name=pages_product_productImage_include_productInfoLabel}
                                                {include file="includes/product_info_label.html" position="product-page" isSpecial=$flag_has_specials dateAvailable=$date_available}
                                            {/block}
	                                        {hook key=tpl_product_img module_data=$product}
                                        </span>
                                    </a>
                                </figure>
                            {/if}
                        </div>
                    </div>
                    {if $more_images && $more_images|@count != 0}
                        <div class="col col-md-2 col-md-pull-10">
                            <div class="more-images row listing equalize-nothing">
                                {foreach name=aussen key=index item=img_data from=$more_images}
                                <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" class="section col{if $index > 3} hidden{/if}{if $index == 3 && $more_images|count > 4} show-more{/if} col-xs-3 col-md-12">
                                    <a href="{img img=$img_data.file type=m_org path_only=true}" class="vertical-helper image-link text-center img-thumbnail" itemprop="contentUrl">
                                        <img src="{img img=$img_data.file type=m_thumb path_only=true}" alt="{$products_name|escape:'html'}" itemprop="thumbnail" class="productImageBorder img-responsive" width="auto" height="auto">
                                    </a>
                                </figure>
                                {/foreach}
                            </div>
                        </div>
                    {/if}
                    <hr class="visible-xs">
                </div>
                {hook key=products_images_tpl}
            </div>
            <div class="col col-sm-5 col-md-4">

	            {if $product_outdated eq 1}
	            <div class="alert alert-error alert-dismissible" role="alert">
		            <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
		            <p class="item"><span class="glyphicon glyphicon-bullhorn"></span>&nbsp;&nbsp;{txt key=PRODUCT_OUTDATED_SHORT}</p>
	            </div>
	            {/if}
	            {if $product_outdated_soon eq 1}
	            <div class="alert alert-warning alert-dismissible" role="alert">
		            <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
		            <p class="item"><span class="glyphicon glyphicon-bullhorn"></span>&nbsp;&nbsp;{txt key=PRODUCT_OUTDATED_SOON_SHORT}</p>
	            </div>
	            {/if}

                <div class="product-info">
                    {hook key=product_info_top product=$product}
                    {if $manufacturer.manufacturers_image}
                        <p class="product-manufacturer image pull-right">
                            <img src="{img img=$manufacturer.manufacturers_image type=m_manufacturer_thumb path_only=true}"
                                 alt="{txt key=HEADING_PRODUCTS_MANUFACTURERS}: {$manufacturer.manufacturers_name|escape:'html'}"
                                 title="{txt key=HEADING_PRODUCTS_MANUFACTURERS}: {$manufacturer.manufacturers_name|escape:'html'}"
                                 class="img-responsive img-thumbnail"
                            >
                        </p>
                    {/if}
                    <h1 itemprop="name" class="title h3 text-word-wrap">{$products_name}</h1>
                    {if $products_model!=''}
                        <p class="product-model">
                            <span class="text-small">{txt key=TEXT_PRODUCTS_MODEL}:</span>
                            <span class="badge badge-lighter">{$products_model}</span>
                        </p>
                    {/if}
                    {if $manufacturer.manufacturers_name}
                        <p class="product-manufacturer name">
                            <span class="text-small">{txt key=HEADING_PRODUCTS_MANUFACTURERS}:</span>
                            <span class="badge badge-lighter">{$manufacturer.manufacturers_name}</span>
                        </p>
                    {/if}
                    {if $products_url}
                    <p class="product-url name">
                        <span class="text-small"><a href="{$products_url}" target="_blank">{$products_url}</a>&nbsp;<span class="text-small glyphicon glyphicon-new-window"></span></span>
                    </p>
                    {/if}
                    <div class="clearfix"></div>
                    {if $smarty.const._CUST_STATUS_SHOW_PRICE eq '1' and $products_price.formated neq ''}
                        <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                            <span class="hidden" itemprop="priceCurrency">{$smarty.const._STORE_CURRENCY}</span>
                            <span class="hidden" itemprop="price">{$products_price.plain|string_format:"%.2f"}</span>
                            <p class="product-price this">
                                {$products_price.formated}
                                <br class="visible-xs">
                                <span class="product-tax">{$products_tax_info.tax_desc}</span>
                            </p>
                        </div>
                        <ul class="product-meta-info">
                            {if $products_shipping_link}
                                <li class="product-shipping"><a href="{$products_shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a></li>
                            {else}
                                <li class="product-shipping">{txt key=TEXT_EXCL_SHIPPING}</li>
                            {/if}
                            {if $base_price && !$group_price}
                                <li class="product-base-price">{$base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$base_price.vpe.name}</li>
                            {/if}
                        </ul>
                        {price_table}
                    {/if}
                    <ul class="product-meta-info bold">
                        {if $stock_image}
                            <li class="product-stock-image">
                                <img src="{img img=$stock_image.image type=t_img_stockrules path_only=true}" class="img-responsive cursor-help" alt="{$stock_image.name}" title="{$stock_image.name}" data-toggle="tooltip" />
                                <span class="sr-only">{$stock_image.name}</span>
                            </li>
                        {/if}
                        {if $shipping_status}
                            <li class="product-shipping-status">{txt key=TEXT_SHIPPING_STATUS} {$shipping_status}</li>
                        {/if}
                        {if $products_weight > 0}
                            <li class="product-weight">{txt key=TEXT_PRODUCTS_WEIGHT} {$products_weight|weight_format:"kg"}</li>
                        {/if}
                    </ul>
                    {if $products_discount!=''}
                        <p class="product-discount">{$products_discount}</p>
                    {/if}

                    {if $products_master_flag == 1 OR  $products_master_model != ''}
                            <div class="ms-options clearfix">
                                {hook key=product_info_tpl_options}
                            </div>
                    {/if}
                    {hook key=product_info_tpl_before_cart}
                    {hook key=product_info_bundle}
                    {if $date_available!=''}
                        <p class="box info">{txt key=TEXT_PRODUCT_AVAILABLE} <strong>{$date_available|date_format:"%d.%m.%Y"}</strong></p>
                    {/if}
                    {if $allow_add_cart eq 'true'}
                        {if $products_fsk18 == '1'}
                            <p class="box error">{txt key=TEXT_PRODUCTS_FSK18_NOTE}</p>
                        {/if}
                    {/if}

	                {hook key="notify_on_restock_tpl.notify_box"}

	                {if $allow_add_cart eq 'true'}
                        <hr />
                        {form type=form name=product action='dynamic' link_params=getParams method=post}
                        {form type=hidden name=action value=add_product}
                        {form type=hidden name=product value=$products_id}
	                    {form type=hidden name=gotoCart value='1'}
                        {$products_information}
                        <div class="add-to-cart clearfix">
                            {if $qtyOptions}
	                        <div class="form-inline">

		                        <div class="input-group" style="display: inline-table;vertical-align: middle;">
			                        <!--input type="number"
										   class="form-control btn-lg btn-qty"
										   min="1"
										   size="1"
										   required="required"
										   step="any"
										   name="qty"
										   autocomplete="off"
										   id="form-qty-{$products_id}"
										   value="1"
										   style="max-width: 5em; height: 2.7em;"
										   placeholder="{txt key=TEXT_QTY}"
									/-->
			                        <div style="display: inline-table;vertical-align: middle;border-left: 1px solid #e0e0e0;border-top: 1px solid #e0e0e0;border-bottom: 1px solid #e0e0e0;">
				                        {form params="id='form-qty-`$products_id`' data-size='5' data-width='auto' data-style='btn btn-lg btn-default btn-qty'" type="select" name="qty" value=$qtyOptions default="1"}
			                        </div>
			                        <label for="form-qty-{$products_id}" class="input-group-addon text-regular" style="width:auto">{$products_unit_name}</label>

		                        </div>

		                        <button type="submit" class="btn btn-lg btn-cart">
			                        <span class="hidden-sm"><i class="fa fa-shopping-basket"></i>&nbsp;&nbsp;</span>
			                        <span class="hidden-sm hidden-md">{txt key=BUTTON_ADD_CART}</span>
			                        <span class="hidden-xs hidden-lg">{txt key=TEXT_CART}</span>
		                        </button>
	                        </div>
                            {/if}
                        </div>
                        {form type=formend}
                    {/if}
                    {hook key=product_info_tpl_cart}

                    {if $review_stars_rating}
                        {math assign=ratingValue equation='(x-1) / 100 * y' x=$review_stars_rating y=5 format='%.1f'}
                        <hr />
                        <div class="product-reviews" {if $ratingValue>0}itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"{/if}>
                            <div class="cursor-pointer" onclick="document.location.href='{$link_reviews_list}'">
                                <div class="reviews_rating_light" data-toggle="popover" data-placement="bottom" data-content="{if $products_rating_count}<i class='fa fa-heart-o'></i> {$products_rating_count} {txt key=TEXT_XT_REVIEWS_INFO}<br /><i class='fa fa-star-o'></i> {$ratingValue} {txt key=TEXT_PAGINATION_FROM} 5{else}{txt key=TEXT_XT_REVIEWS_NO_REVIEWS}{/if}">
                                    <i></i><i></i><i></i><i></i><i></i>
                                    <div class="reviews_rating_dark" style="width:{$review_stars_rating}%">
                                        <i></i><i></i><i></i><i></i><i></i>
                                    </div>
                                </div>
                            </div>
                            {if $ratingValue>0}
                            <span class="text-muted text-small">{txt key=TEXT_REVIEW_RATING}: <span itemprop="ratingValue">{$ratingValue}</span> {txt key=TEXT_PAGINATION_FROM} 5</span>
                            <span itemprop="itemreviewed" class="hidden">{$products_name}</span>
                            <span itemprop="ratingCount" class="hidden">{if $products_rating_count}{$products_rating_count}{else}0{/if}</span>
                            {else}
                            <span class="text-muted text-small">{txt key=TEXT_XT_REVIEWS_NO_REVIEWS}</span>
                            {/if}
                            <div class="clearfix"></div>
                        </div>
                    {/if}
                    
                    {hook key=products_info_bottom}
                </div>
            </div>
        </div>

        <div class="pcontent">

            {if ($products_master_flag == 1 || $products_master_model!='') && ($smarty.const._PLUGIN_MASTER_SLAVE_SHOW_SLAVE_LIST==1 || $smarty.const._PLUGIN_MASTER_SLAVE_SHOW_SLAVE_LIST=='true')}
                <div id="options-list" class="info-panel">
                    {hook key=product_info_tpl_productlist}
                </div>
            {/if}

            {if $products_description && $products_description|strip_tags|trim != ''}
                <div id="description" class="textstyles text-word-wrap info-panel">
                    <p class="headline"
                       data-toggle="collapse"
                       data-target="#description-collapse"
                       aria-expanded="true"
                       aria-controls="description-collapse">
                        {txt key=TEXT_PRODUCTS_DESCRIPTION}
                    </p>
                    <div id="description-collapse" class="collapse collapse-auto-toggle-xs in">
                        {$products_description}
                        <div class="clearfix"></div>
                    </div>
                </div>
            {/if}

            {if $media_files !=''}
                <div id="files" class="info-panel">
                    <p class="headline"
                       data-toggle="collapse"
                       data-target="#files-collapse"
                       aria-expanded="true"
                       aria-controls="files-collapse">
                        {txt key=TEXT_DOWNLOADS}
                    </p>
                    <div id="files-collapse" class="collapse collapse-auto-toggle-xs in">
                        {block name=pages_product_mediaFiles_include_productPublicFiles}
                            {include file="xtCore/pages/files/product_public_files.html"}
                        {/block}
                    </div>
                </div>
            {/if}

            {hook key=product_info_tpl}
            {hook key=product_info_tpl_tab_headline}
            {hook key=product_info_tpl_tab_box}

            {if $review_stars_rating}
                <div id="reviews" class="info-panel">
                    <p class="headline"
                       data-toggle="collapse"
                       data-target="#reviews-collapse"
                       aria-expanded="true"
                       aria-controls="reviews-collapse">
                        {txt key=TEXT_XT_REVIEWS_INFO}
                    </p>
                    <div id="reviews-collapse" class="collapse collapse-auto-toggle-xs in">
                        {hook key=product_info_tpl_reviews}
                    </div>
                </div>
            {/if}

            {hook key=product_info_tpl_tab_box_2}

        </div>

    </div>
{/block}
