{if !$hideSubmit}
<div data-reload="variation">
   {$isSet = isset($product.campaign_codes.PS)}

   {$product_soldout = true}
   {$show_restock = true}

   {if !$product->canBuy()}
   {elseif $product.deliveryTime == 0 or $product.deliveryTime == -3}
      {$product_soldout = false}
      {$show_restock = false}
   {elseif $dbcfg.order_not_in_store == 'N' }
   {elseif $cfg.Products.allowSoldoutToCart[$product.deliveryTime] or
   $cfg.Products.allowSoldoutToCart[1] and $product.deliveryTime > 0}
      {$product_soldout = false}
   {/if}

   {if !$isSet and $product_soldout}
      {include "product/product.price-block.tpl"}
   {/if}

   {if !$product_soldout}
      <form action="{url s=cart}" method="get" data-buy-form id="buy-form">
         <input type="hidden" name="act" value="add">
         <input type="hidden" name="redir" value="1">
         <input type="hidden" name="IDproduct" value="{$product.id}" data-detail-productid>
         {if $product.variationId}
            <input type="hidden" name="IDvariation" value="{$product.variationId}">
         {/if}

         {if $product.campaign_codes['J']}
            <div class="form-group form-group-nametag required">
               <label for="note[name]">{t}Vyplňte jméno vašeho rošťáka{/t}</label>
               <input type="text" name="note[name]" id="note[name]" value="" class="form-control" form="buy-form" required>
            </div>
            <div class="form-group form-group-nametag required">
               <label for="note[bike_size]">{t}Vyplňte velikost kola{/t}</label>
               <input type="text" name="note[bike_size]" id="note[bike_size]" value="" class="form-control" form="buy-form" required>
            </div>
         {/if}

         {if !$isSet}
            {include "product/product.price-block.tpl"}
         {/if}

         {ifmodule PRODUCTS_CHARGES}
            {include "product/product.charges.tpl"}
         {/ifmodule}

            {include "product/product.submit-block.tpl" listType="detail" listId=$product.id hide_buycount=true}
            {if $product.product.variations.variations[$product.variationId].data.restock_date}
               <div class="variation-restock-date in-store delivery delivery--1">
                  {$product.product.variations.variations[$product.variationId].data.restock_date}
               </div>
            {/if}
            {include "product/product.delivery.tpl"}
      </form>
   {else}
      {ifmodule WATCHDOG}
         <div class="product-watchdog-info">
            {if $product.product.variations.variations[$product.variationId].data.restock_date}
               <div class="variation-restock-date delivery delivery--1">
                  {$product.product.variations.variations[$product.variationId].data.restock_date}
               </div>
            {/if}
            <p>{t}Tento produkt nemáme momentálně skladem. Pokud chcete dát vědět, až bude produkt zase dostupný, vyplňte níže svůj e-mail.{/t}</p>
            <a href="" class="btn btn-primary" data-focus-opener="product-watchdog">{t}Hlídat dostupnost{/t}</a>
         </div>

         {include "focus/focus.product-watchdog.tpl" class="product-watchdog"}
      {/ifmodule}
   {/if}

   {ifmodule QUANTITY_DISCOUNT}
      {include "product/product.quantityDiscounts.tpl"}
   {/ifmodule}

   {ifmodule BONUS_PROGRAM}
      {include "product/bonus-points.tpl"}
   {/ifmodule}

   {ifmodule SHOPPING_LIST}
   {if $ctrl.logged}
      {include "focus/focus.add-shopping-list.tpl" class="shopping-list" }
   {/if}
   {/ifmodule}


   {*{ifmodule RESERVATIONS}
      <a href="#"
         data-wpj-focus="{path('kupshop_reservation_reservation_focusreservationcreate', ['productId' => $product.id, 'variationId' => $product.variationId])}"
         data-wpj-focus-ajax="1">
         Rezervovat zboží
      </a>
   {/ifmodule}*}
</div>
{/if}

{if !$hideGallery}
   <div data-reload="variation-gallery">
      {include "product/product.gallery.tpl"}
   </div>
{/if}

{if !$hideStickyPhoto}
   <div data-reload="variation-sticky-photo">
      {if $product.variationId and $product.product.variations.variations[$product.variationId].photos[0]}
         {$mainPhoto = $product.product.variations.variations[$product.variationId].photos[0]}
      {elseif $product.product}
         {$mainPhoto = $product.product.image}
      {else}
         {$mainPhoto = $product.image}
      {/if}
      {if $mainPhoto}
         <div class="img">
            {$photo_dimensions = $cfg.Photo.types["product_cart"].size}
            <img src="{get_photo photo=$mainPhoto size="product_cart"}" width="{$photo_dimensions[0]}"
                 height="{$photo_dimensions[1]}" loading="lazy" alt="{$product.title}" class="img-responsive">
         </div>
      {/if}
   </div>
{/if}

{if !$hideCode}
   <div data-reload="variation-code">
      {if $product.code}<p>{t}Kód:{/t} {$product.code}</p>{/if}
      {if $product.ean}<p>{t}EAN:{/t} {$product.ean}</p>{/if}
   </div>
{/if}
