{* data-cart-noreload znamena, ze ho nehandluje wpj.cart.js (ktery reloaduje kosik po hned po input change),
   ale custom kod v wpj.cart.voucher.js (reloaduje az po kliknuti na tlacitko) *}
<div class="cart-voucher" data-cart-voucher data-reload="cart-voucher" data-cart-noreload>
   {if $hidden and !$body.coupons and !$body.couponNo}
      <p><a href="" data-voucher-show>{$voucher_title|default:"{t}Mám slevový kód{/t}"}</a></p>
   {/if}

   <div class="input-group">
      <input type="text" name="couponNo" placeholder="{$voucher_placeholder_descr|default:"{t}Mám slevový kód{/t}" nofilter}" value="{$body.couponNo}" class="form-control">
      <button type="submit" name="AddDiscount" value="1" class="btn {$tpl_vars.voucher_btn_class}" disabled>{t}Uplatnit{/t}</button>
   </div>

   {if $body.coupons}
      <div class="cart-vouchers-active">
         {foreach $body.coupons as $coupon}
            <div class="item">
               <div class="title">{t}Uplatněný slevový kód:{/t} <strong>{$coupon}</strong></div>
               <button type="button" name="DeleteDiscount" value="{$coupon}" class="btn btn-link">
                  {t}Odstranit{/t}
               </button>
            </div>
            {ifmodule ORDER_DISCOUNT}
               {get_coupon_price coupon=$coupon cart=$body assign=couponPrice}
               {if $couponPrice}
                  <div class="small" style="text-align: right">
                     Hodnota poukazu {$couponPrice.coupon_price|format_price:"ceil=no;decimal=dynamic"},
                     uplatněno {$couponPrice.used_coupon_price|format_price:"ceil=no;decimal=dynamic"},
                     zbývá {$couponPrice.remaining_coupon_price|format_price:"ceil=no;decimal=dynamic"}.
                  </div>
               {/if}
            {/ifmodule}
         {/foreach}
      </div>
   {/if}
</div>
