67 lines
3.3 KiB
Smarty
67 lines
3.3 KiB
Smarty
<div class="cart-benefit">
|
|
|
|
<div class="benefit-header">
|
|
<p>{t}Uplatnit body{/t}</p>
|
|
{if $ctrl.logged}
|
|
<p>{if $activePoints > 0}{t plural="Máte celkem {$activePoints} body" plural5="Máte celkem {$activePoints} bodů" count=$activePoints points=$activePoints}Máte celkem {points} bod{/t}{else}{t}Zatím nemáte žádné body{/t}{/if}</p>
|
|
{/if}
|
|
</div>
|
|
|
|
<div class="benefit-selecter">
|
|
<div data-reload="cart-benefit-selecter">
|
|
{$allowed = false}
|
|
{foreach $bonuses as $coupon}
|
|
{if $coupon.allowed}
|
|
<label class="custom-control custom-checkbox {if (($activePoints-$usedPoints) < $coupon.condition_value and !$body.discountData.bonus_program[$coupon.id]) or $body.totalPriceWithVat < $coupon.min_price}disabled{/if}">
|
|
|
|
<input type="checkbox" name="discount[bonus_program][{$coupon.id}]" id="{$coupon.id}" value="{$coupon.id}"
|
|
class="form-control custom-control-input" {if $body.discountData.bonus_program[$coupon.id]}checked{/if}>
|
|
<span class="custom-control-indicator"></span>
|
|
<span class="title">
|
|
{$coupon.descr}
|
|
{if $body.totalPriceWithVat < $coupon.min_price}
|
|
<small>{t escape=false price=$coupon.min_price|format_price}Pro uplatnění slevy musíte nakoupit alespoň za <strong>{price}</strong>{/t}</small>
|
|
{/if}
|
|
</span>
|
|
<span>{t pocetBodu=$coupon.condition_value}{pocetBodu} b.{/t}</span>
|
|
</label>
|
|
{$allowed = true}
|
|
{/if}
|
|
{/foreach}
|
|
|
|
{if !$allowed}
|
|
<label>
|
|
{if $ctrl.id}
|
|
{t}Nemáte dostatek bodů pro uplatnění slevy.{/t}
|
|
{else}
|
|
{t escape=false url={url s=login}}Pro uplatnění bodů se <a href="{url}" class="cart-signin">přihlaste</a>.{/t}
|
|
{/if}
|
|
</label>
|
|
{/if}
|
|
</div>
|
|
<div class="inactive-coupon">
|
|
{$inactiveCoupon = 0}
|
|
{foreach $bonuses as $coupon}
|
|
{if !$coupon.allowed}
|
|
{$inactiveCoupon = $inactiveCoupon + 1}
|
|
<label class="custom-control custom-checkbox disabled">
|
|
<input type="checkbox" name="discount[bonus_program][{$coupon.id}]" id="{$coupon.id}" value="{$coupon.id}"
|
|
class="form-control custom-control-input" {if $body.discountData.bonus_program[$coupon.id]}checked{/if}>
|
|
<span class="custom-control-indicator"></span>
|
|
<span class="title">{$coupon.descr}</span>
|
|
<span>{t pocetBodu=$coupon.condition_value}{pocetBodu} b.{/t}</span>
|
|
</label>
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
|
|
<input type="hidden" name="discount[bonus_program][0]" id="0" value="0">
|
|
</div>
|
|
|
|
{if $inactiveCoupon > 0}
|
|
<div class="benefit-more">
|
|
<a href="#" class="benefit-show-inactive" data-opener=".inactive-coupon"><span class="show">{t}Zobrazit výhody věrnostního programu{/t}</span><span
|
|
class="hide">{t}Skrýt výhody věrnostního programu{/t}</span></a>
|
|
</div>
|
|
{/if}
|
|
</div> |