<div data-reload="variation">
   {$isSet = isset($product.campaign_codes.PS)}
   {$isGiftCard = ($body.product.data.generate_coupon == 'Y') && ($body.product.data.gift_card == 'Y')}

   {$product_soldout = true}

   {if $product.deliveryTime == 0}
      {$product_soldout = 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 && !$isGiftCard}
      {include "product/product.price-block.tpl"}
   {/if}

   {if !$product_soldout}
      <form action="{url s=cart}" method="get" data-buy-form>
         {if $isGiftCard}
            <label for="note[gift_card][price]" class="h3">{t}Hodnota{/t}</label>
            {get_contexts currency=1 assign="contexts"}
            {$currency = $contexts.currency->getActive()}
            <input name="note[gift_card][currency]" type="hidden" value="{$currency->getId()}">
            <div class="submit-block">
               <input name="note[gift_card][price]" placeholder="{t}Zadejte, prosím, požadovanou částku{/t}"
                      class="form-control configuration-text-input" id="note[gift_card][price]" type="number" min="1">
               <div class="form-control" style="width: 60px; border-left: 0; text-align: center;">{$currency->getSymbol()}</div>
            </div>
            <p class="annotation">{t}Dárkovou kartu odešleme e-mailem ihned po zaplacení.{/t}</p>
         {/if}
         <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}

          {ifmodule PRODUCT_SETS}
             {* pokud mam sety a je v nem predvybrana varianta, tak chci pri pridavani do kosiku odesilat notu s vybranou variantou *}
             {if $body.product.sets}
                 {foreach $body.product.sets as $set_product}
                     {if $set_product.selected_variation}
                        <input type="hidden" name="note[set_variation][{$set_product.id}]"
                               value="{$set_product.selected_variation}">
                     {/if}
                     {* TODO: tady by teoreticky mel byt else, kterej zobrazi checkboxy na vybrani varianty, kterou chci pridat *}
                     {* TODO: uplne stejne se to dela v ordering.sets.tpl *}
                 {/foreach}
             {/if}
          {/ifmodule}

         {if $isSet}
            {include "product/sets/product.sets.selected.tpl"}
            {include "product/product.price-block.tpl"}
         {else}
            <p class="delivery-timetable">
                             <span class="delivery delivery-{$product.deliveryTime}" data-deliverytime>
                              {$product.deliveryTimeText}
                             </span>
               <a href="" data-focus-opener="product-delivery">{t}Kdy zboží obdržím?{/t}</a>
               {*<a href="" data-wpj-focus="{path('kupshop_content_focus_focuslazy', ['template' => 'product-delivery', 'productId' => $product.id, 'variationId' => $product.variationId])}">{t}Kdy zboží obdržím?{/t}</a>*}
            </p>
         {/if}

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

         {if $isSet}
            {include "product/sets/product.submit-block.set.tpl"}
         {else}
            {include "product/product.submit-block.tpl" listType="detail" listId=$product.id}
         {/if}
      </form>
   {else}
      {ifmodule WATCHDOG}
         {include "product/product.watchdog.tpl"}
      {/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>
