{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '<')}
{foreach from=$an_staticblock->products item="product"}
{include file='$tpl_dir./product-list.tpl' product=$product}
{/foreach}
{else}
<h2 class="column-title h1 products-section-title">{$an_staticblock->title|escape:'htmlall':'UTF-8'}</h2>
<div class="js-products-column-slider owl-carousel" id="js-products-column-slider-{$an_staticblock->id}" {if $an_staticblock->formdata} data-nav="{$an_staticblock->formdata->additional_field_item_nav}" data-dots="{$an_staticblock->formdata->additional_field_item_dots}" data-loop="{$an_staticblock->formdata->additional_field_item_loop}" data-autoplay="{$an_staticblock->formdata->additional_field_item_autoplay}" data-autoplaytimeout="{$an_staticblock->formdata->additional_field_item_autoplayTimeout}"{/if}>

  {foreach from=$an_staticblock->products name="products" item="product"}
  {$it=$smarty.foreach.products.iteration}
  {if ( ($it+$an_staticblock->formdata->additional_field_item_items-1) is div by $an_staticblock->formdata->additional_field_item_items)}
  <div class="item">
    {/if}

    {block name='product_miniature_item'}
    <div class="product-container js-product-miniature" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}">
      <div class="product-img">
		<a href="{$product.url}" class="product-img-link">
        {block name='product_thumbnail'}
          <img
            class="{if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')} b-lazy {/if}"
            {if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')}
            data-lazy-gif="{$urls.base_url}/modules/an_theme/views/img/loading.gif"
            {/if}
            src="{if Module::getInstanceByName('an_theme')->getParam('product_lazyLoad')}
            {$urls.base_url}/modules/an_theme/views/img/loading.gif
            {else}
            {$product.cover.bySize.home_default.url}
            {/if}"
          alt = "{$product.cover.legend}"
          data-full-size-image-url = "{$product.cover.large.url}"
          width="{$product.cover.bySize.home_default.width}"
          height="{$product.cover.bySize.home_default.height}"
          data-width="{$product.cover.bySize.home_default.width}"
          data-height="{$product.cover.bySize.home_default.height}"
          content="{$product.cover.bySize.home_default.url}"
          data-src="{$product.cover.bySize.home_default.url}"
          >
        {/block}
		
      {block name='product_flags'}
      <ul class="product-flags">
        {foreach from=$product.flags item=flag}
          <li class="{$flag.type}">{$flag.label}</li>
        {/foreach}
        {if $product.has_discount}
          {if $product.discount_type === 'percentage'}
		   <li class="discount-percentage">{$product.discount_percentage}</span>
	      {/if}
        {/if}
      </ul>
      {/block}
	  </a>
      </div>
      <div class="product-desc">

        {block name='product_name'}
        <h5 class="product-name"><a href="{$product.url}">{$product.name|truncate:30:'...'}</a></h5>
        {/block}

        {block name='product_price_and_shipping'}
        {if $product.show_price}
          <div class="product-price">
            {if $product.has_discount}
            {hook h='displayProductPriceBlock' product=$product type="old_price"}
            <span class="old-price">{$product.regular_price}</span>
            {/if}

            {hook h='displayProductPriceBlock' product=$product type="before_price"}
            <span class="price">
              <span class="money new-price" data-currency-{$currency.iso_code|lower}="{$product.price}">{$product.price}</span>
            </span>

            {hook h='displayProductPriceBlock' product=$product type='unit_price'}

            {hook h='displayProductPriceBlock' product=$product type='weight'}
          </div>
        {/if}
        {/block}
        <div class="product-btn hidden-sm">
          {block name='quick_view'}
          <a class="quick-view" href="#" data-link-action="quickview">
            <i class="material-icons">loupe</i> {l s='Quick view' d='Shop.Theme.Actions'}
          </a>
          {/block}

        </div>
      </div>
    </div>
    {/block}

    {if ( $smarty.foreach.products.iteration is div by $an_staticblock->formdata->additional_field_item_items)}
  </div>
  {/if}
  {/foreach}
  {if !isset($it)}
  {$it = 0}
  {/if}  
  {if !( $it is div by $an_staticblock->formdata->additional_field_item_items)}
</div>
{/if}
</div>
{/if}