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

65 lines
2.8 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-thepay payment-item-{$name|lower|strip_accent}
{if $method@index >= $tpl_vars.online_payment_visible_items|default:2 and $closed}hidden" style="display: none;{/if}">
<label for="pay{$method_id}" class="delivery-content custom-radio custom-control">
<input type="radio" name="payment_id" value="{$method_id}" id="pay{$method_id}"
class="custom-control-input" {$body.payment_id|checked:$method_id nofilter}>
<span class="custom-control-indicator"></span>
{block "thepay-img"}
<span class="img"><img src="https://www.thepay.cz/gate/images/logos/public/209x127/{$name}.png" style="width: 75px; height: auto;"
title="{$method.name}" alt="{$method.name}"></span>
{/block}
<span class="name">{$method.name}
<span data-reload="payment-tp-exception_{$method_id}">
{if $payment.exception}
<span class="subtitle">{$payment.exception->getShortMessage()}</span>
{/if}
</span>
</span>
<span class="price">
<span data-reload="payment_price_{$method_id}">
{$paymentPrice = $view->getPaymentPrice($id)}
{if $paymentPrice && $paymentPrice.value_with_vat->isPositive()}
{$paymentPrice.value_with_vat|format_price}
{else}
{t}zdarma{/t}
{/if}
</span>
</span>
</label>
</div>
{block "thepay-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="https://www.thepay.cz/gate/images/logos/public/209x127/{$name}.png"
style="width: 60px; height: auto; margin: 5px 0;"
title="{$method.name}" class="payment-item-small">
{/if}
{/foreach}
</div>
<div>
<a href="" class="thepay-more btn {$tpl_vars.payment_more_class|default:"btn-primary"}" id="thepay-more">{t}Více{/t}</a>
</div>
</div>
{/if}
{/block}
{/foreach}
<script>
wpj.onReady.push(function() {
$('#thepay-more').on('click', function() {
$(this).closest('.payments-list').hide();
$('.payment-item.hidden').removeClass('hidden').fadeIn();
return false;
});
});
</script>