{if !$product}
    {$product = $body.product}
{/if}

<div class="submit-block">
    {$step = 1}

    {ifmodule PRODUCTS__STEP}
    {$data = $product->getData()}
    {$step = $data.step|default:$step}
    {/ifmodule}

    {if !$hide_buycount}
       <div class="buy-count-wrapper">
          <input class="form-control" type="number" name="No" title="{t}Počet kusů{/t}" value="{$step}" step="{$step}" data-filter="noreload">
          <div class="buy_count">
             <button type="button" class="fc icons_caret-up plus_unit"
                     title="{t mnozstvi=$step}Přidat {mnozstvi} ks{/t}"></button>
             <button type="button" class="fc icons_caret-down minus_unit"
                     title="{t mnozstvi=$step}Odebrat {mnozstvi} ks{/t}"></button>
          </div>
       </div>
    {else}
       <input type="hidden" name="No" value="{$step}">
    {/if}

   {block "submit-btn"}
      <button type="submit" class="btn btn-insert" data-submit-btn data-tracking-clickAddToCart='{get_gtm_data encode=true type='ecommerce' method='ClickAddToCart' data=['product' => $product, 'listType' => $listType, 'listId' => $listId]}'>
          {$submit_text|default:"{t}Vložit do košíku{/t}" nofilter}

          {if $body.product.variations.variations|count && $isProductDetail}
             <span class="non-variation" data-variation-error>{t}Vyberte variantu{/t}</span>
          {/if}

         {if $product.variationId}
            {$visible_variations = 0}
            {foreach $product.product.variations.variations as $variation}
               {* 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}
               {/if}
               {$visible_variations = $visible_variations + 1}
            {/foreach}
            {if $visible_variations >= 1}
               <span class="variation-title">
                 {$product.product.variations.labels[$product.product.variations.variations[$product.variationId].combinations[0].id_label].values[$product.product.variations.variations[$product.variationId].combinations[0].id_value]}
               </span>
            {/if}
         {elseif $product.param[90].value}
             <span class="variation-title">{$product.param[90].value}</span>
         {/if}
      </button>
   {/block}

    {ifmodule PRODUCTS_FAVORITES}
    {if !$hide_favorites}
        {include "product/product.js-add-to-favorites.tpl"}
    {/if}
    {/ifmodule}
</div>
