<div class="row catalog-row-top10"
     data-tracking-view='{get_gtm_data encode=true type='ecommerce' method='ProductsImpressions' data=['products' => $products, 'listType' => $listType, 'listId' => $listId]}'>
    {$products->fetchPhotos(4)}
    {$products->fetchParameters([90])}
    {foreach $products as $product}
       <div class="col-md-6 col-xxs-12">
          <div class="catalog catalog-top10" id="prod-{$product@iteration}">
             <div class="product-link" title="{$product.title}" data-gallery-wrapper>
                <div class="catalog-top10-gallery">
                   <a href="{get_photo photo=$product.image size=0}" title="{$product.title}" data-rel="gallery"
                      class="img main-image">
                       {$photo_dimensions = $cfg.Photo.types['product_detail'].size}
                      <img src="{get_photo photo=$product.image size='product_detail'}" alt="{$product.title}"
                           width="{$photo_dimensions[0]}" height="{$photo_dimensions[1]}" class="img-responsive">

                      <div class="catalog-flags flags">
                         <span class="flag flag-top-ten">{t}Top 10{/t}</span>

                          {include 'product/product.flags.tpl'}
                      </div>
                   </a>
                   <div class="gallery">
                       {$photo_dimensions = $cfg.Photo.types["product_gallery"].size}
                       {if $product.photos|count>1}
                       {foreach $product.photos|array_slice:0:3 as $photo}
                          <a href="{get_photo photo=$photo size=0}" title="{$product.title}" data-rel="gallery" class="img">
                             <img src="{get_photo photo=$photo size='product_gallery'}" alt="{$product.title}" class="img-responsive" width="{$photo_dimensions[0]}" height="{$photo_dimensions[1]}">
                          </a>
                       {/foreach}
                      {/if}
                   </div>
                </div>
             </div>

             <div class="catalog-content">
               <div class="d-flex">
                  <div>
                     <a href="{url s=product IDproduct=$product.id TITLE=$product.title}" class="product-link"
                        data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'>
                        <p class="producer">{$product.producer.name|default:'&nbsp;' nofilter}</p>
                        <h3 class="heading-reset title">{$product.title|replace:$product.producer.name:''}</h3>
                        <p class="perex">{$product.descr}</p>
                     </a>
                  </div>

                   {calc_product_discount product=$product assign='discount'}
                  <p class="price">
                      {if $discount.discount->asFloat() >= 1}
                         <del class="strike-price">{$discount.priceOriginal|format_price}</del>
                      {*{elseif $product.productPrice.value_with_vat->lowerThan($product.productPrice.originalPrice.value_with_vat)}
                         <del class="strike-price">{$product.productPrice.originalPrice|format_price}</del>*}
                      {/if}
                     <strong>
                         {$product.productPrice|format_price}
                     </strong>

                      {if !$cfg['znz_tpl']['hide_price_per_unit']}
                          {get_znz_unit_price product=$product assign='unitPrice'}
                          {if !$unitPrice.price.price_with_vat->equals($product.productPrice.price_with_vat) && $unitPrice.unit}
                              {$t = "{$unitPrice.price|format_price} / {$unitPrice.unit}"}
                          {/if}
                         <span class="unit-price">{$t|default:'&nbsp;' nofilter}</span>
                      {/if}
                  </p>
               </div>

                <div class="catalog-btn">
                    {if $product.variations|count > 1}
                       <a href="{url s=product IDproduct=$product.id TITLE=$product.title}" class="btn btn-block btn-primary"
                          data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'>
                           {t}Vybrat variantu{/t}
                       </a>
                    {else}
                       <form action="{url s=cart}" method="get" data-buy-form>
                          <input type="hidden" name="act" value="add">
                          <input type="hidden" name="redir" value="1">
                          <input type="hidden" name="IDproduct" value="{$product.id}">
                          {if $product.variations and $product.variations|count == 1 and $product.variationsIds[0]}
                             <input type="hidden" name="IDvariation" value="{$product.variationsIds[0]}">
                          {/if}
                          {include 'product/product.submit-block.tpl' submit_text="{t}Vložit do košíku{/t}" hide_buycount=1 hide_favorites=1}
                       </form>
                    {/if}
                </div>

                 {get_delivery_dates product=$product assign='deliveries'}
                 {$deliveryDate = $deliveries.min.delivery}
                <div class="availability">
                   <p><i class="fc icons_{if $product.inStore}check{else}{/if}-circle"></i>
                       {if $product.deliveryTime == 0}{t}Skladem pro nákup online{/t}{else}{$product.deliveryTimeText}{/if}{if $product.inStore > 5}&nbsp;>&nbsp;5&nbsp;{t}ks{/t}{elseif $product.inStore > 0}&nbsp;{$product.inStore}&nbsp;{t}ks{/t}{/if}
                   </p>

                    <p>
                        {if $deliveries.min.deliveryPrice && $deliveries.min.deliveryPrice->getValue()->asFloat() > 0}
                            {t price=$deliveries.min.deliveryPrice|format_price date=$deliveryDate|format_date_locale_pretty:'d. L.':null:true escape=false}Ihned k odeslání <strong>od {price}</strong>, u vás doma již&nbsp;<strong>{date}</strong>.{/t}
                        {else}
                            {t date=$deliveryDate|format_date_locale_pretty:'d. L.':null:true escape=false}<strong>Doprava Zdarma</strong>, u vás doma již <strong>{date}</strong>.{/t}
                        {/if}
                    </p>
                </div>
             </div>
         </div>
       </div>
    {/foreach}
</div>
