{if $product.variations and $product.deliveryTime == 0}
   <div class="catalog-variations">
      {$v = 0}

      {foreach $product.variations as $id => $var}
         {if $var.delivery_time != 0 and $dbcfg.prod_show_not_in_store == "N"}
            {* varianta je vyprodana a v adminu je vypnute zobrazovani vyprodanych produktu *}
            {continue}
         {/if}

         {$soldout = true}

         {if $var.delivery_time == 0}
            {* varianta je skladem *}
            {$soldout = false}
         {elseif $dbcfg.order_not_in_store == 'N' }
            {* varianta není skladem a je zakázáno kupování vyprodaných prod. v adminu *}
         {elseif $cfg.Products.allowSoldoutToCart[$var.delivery_time] or
         $cfg.Products.allowSoldoutToCart[1] and $var.delivery_time > 0}
            {* delivery_time_index varianty je povoleny v configu *}
            {$soldout = false}
         {/if}

         {if $v == 4 and !$var@last}
            <a href="{url s=product IDproduct=$product.id TITLE=$product.title}" class="more-variations"
               title="{t pocet={$product.variations|count - 4}}a {pocet} další velikosti{/t}"
            {if $dbcfg.analytics.google_tag_manager.gtm_dl_version == 2} data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'{/if}>+{$product.variations|count - 4} dalších</a>
            {break}
         {elseif !$soldout}
            {* array filter ostrani prazdne hodnoty pol, implode je spoji do stringu oddeleneho carkou *}
            <a href="{url s=product IDproduct=$product.id TITLE=$product.title}#{$id}"
               {if $dbcfg.analytics.google_tag_manager.gtm_dl_version == 2} data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='ProductClick' data=['product' => $product, 'position' => $product@iteration, 'listType' => $listType, 'listId' => $listId]}'{/if}>{', '|implode:array_filter($var.values)}</a>
            {$v = $v+1}
         {/if}
      {/foreach}
   </div>
{/if}
