<div class="size-convertion-list">
   {$groupedVars = []}
   <div class="sizes product-variation-size-convertion">
      {foreach $sizes as $id => $values}
         {foreach $values as $variation_id => $size}
            {$groupedVars[$variation_id].values[$id] = $size}
         {/foreach}
         <span class="size">{$id}</span>
      {/foreach}
   </div>
   {foreach $groupedVars as $variation_id => $var}
      {$variation = $body.product.variations.variations[$variation_id]}

      {* varianta je vyprodana a v adminu je vypnute zobrazovani vyprodanych produktu *}
      {if $variation.delivery_time_index != 0 and $dbcfg.prod_show_not_in_store == "N"}
         {continue}
      {elseif $variation.variation_figure != "Y"}
         {continue}
      {/if}

      {$soldout = true}

      {if $variation.delivery_time_index == 0}
         {* varianta je skladem *}
         {$soldout = false}
      {elseif $variation.delivery_time_index == -3}
         {$soldout = false}
      {elseif $dbcfg.order_not_in_store == 'N' }
         {* varianta není skladem a je zakázáno kupování vyprodaných prod. v adminu *}
         {* $soldout je true *}
      {elseif $cfg.Products.allowSoldoutToCart[$variation.delivery_time_index] or
      ($cfg.Products.allowSoldoutToCart[1] and $variation.delivery_time_index > 0)}
         {* delivery_time_index varianty je povoleny v configu *}
         {$soldout = false}
      {/if}
      <input name="IDvariation_{$id|strip_accent}" type="radio" value="{$variation_id}"
             id="var_{$id|strip_accent}_{$variation_id}"
              {if $soldout and !findModule('watchdog')} disabled
                 {*{elseif $precheck_single and $body.product.variations.variations|count == 1 or $p == 1}checked{$p = $p + 1}*}{/if}
      >
      <label for="var_{$id|strip_accent}_{$variation_id}" data-variation-id="{$variation_id}"
             data-title="{foreach $var.values as $type => $value}{if !$value@first}&nbsp;&nbsp;|&nbsp; {/if}{$type|upper} {$value}{/foreach}"
             class="product-variation-size-convertion {if $soldout}soldout {if findModule('watchdog')}watchdog{else}disable{/if}{/if}">

         {foreach $var.values as $type => $value}
            <span class="size"> {$value} </span>
         {/foreach}
         {if !$hide_availability}
            <span class="delivery delivery-{$delivery_var[$variation_id].deliveryTime}">
                     {$delivery_var[$variation_id].deliveryTimeText}
               {if $delivery_var[$variation_id].inStore > 5}
                  >&nbsp;5&nbsp;{t}ks{/t}
               {elseif $delivery_var[$variation_id].inStore > 1}
                  {$delivery_var[$variation_id].inStore}&nbsp;{t}ks{/t}
               {elseif $delivery_var[$variation_id].inStore == 1}
                  {t}poslední kus{/t}
               {/if}
            </span>
         {/if}
      </label>
   {/foreach}
</div>
