Files
kupshop/web/templates/x/payment.GoPay.cart.tpl
2025-08-02 16:30:27 +02:00

66 lines
2.9 KiB
Smarty

{$closed = $body.payment_id|strpos:{$payment.id|cat:'-'} !== 0}
{foreach $object->getAvailableMethods() as $name => $method}
{$method_id = "{$id}-{$name}"}
<div class="cart-box-row payment-item payment-item-gp payment-item-{$name|lower|strip_accent}
{if $method@index >= $tpl_vars.online_payment_visible_items|default:2 and $closed}hidden" style="display: none;{/if}"
data-tracking-click-delivery-type='{get_gtm_data encode=true type='ecommerce' method='AddPaymentInfo' data=['payment' => $payment, 'method' => $method]}'>
<label for="pay{$method_id}" class="delivery-content custom-radio custom-control">
<input type="radio" name="payment_id" value="{$method_id}" class="custom-control-input" id="pay{$method_id}"
{if $body.payment_id == $method_id}checked{/if}>
<span class="custom-control-indicator"></span>
{block "gopay-img"}
<span class="img"><img src="{$method.image}" title="{$method.name}" alt="{$method.name}"
style="width: 75px; height: auto;"></span>
{/block}
{block "gopay-name"}
<span class="name">{$method.name}
<span data-reload="payment-gp-exception_{$method_id}">
{if $payment.exception}
<span class="subtitle">{$payment.exception->getShortMessage()}</span>
{/if}
</span>
</span>
{/block}
<span class="price">
<span data-reload="payment_price_{$method_id}">
{if $payment.price.value_with_vat->isPositive()}
{$payment.price.value_with_vat|format_price}
{else}
{t}zdarma{/t}
{/if}
</span>
</span>
</label>
</div>
{block "gopay-items-hidden"}
{if $method@index == ($tpl_vars.online_payment_visible_items|default:2 - 1) and $closed and !$method@last}
<div class="cart-box-row payment-item thepay-method payments-list">
<div>
{foreach $object->getAvailableMethods() as $name => $method}
{if $method@index > 1}
<img src="{$method.image}" title="{$method.name}" alt="{$method.name}"
style="width: 60px; height: auto; margin: 5px 0;" class="payment-item-small">
{/if}
{/foreach}
</div>
<div>
<a href="" class="thepay-more btn {$tpl_vars.payment_more_class|default:"btn-primary"}" id="gopay-more" title="{t}Zobrazit více platebních metod{/t}">{t}Více{/t}</a>
</div>
</div>
{/if}
{/block}
{/foreach}
<script>
wpj.onReady.push(function() {
$('body').on('click', '#gopay-more', function() {
$(this).closest('.payments-list').hide();
$('.payment-item.hidden').removeClass('hidden').fadeIn();
return false;
});
});
</script>