Files
kupshop/web/templates/x/ordering/ordering.summary-sidebar.v2.tpl
2025-08-02 16:30:27 +02:00

126 lines
4.8 KiB
Smarty

{* @compiler:inline-only *}
{block 'sidebar-prepend'}{/block}
<div class="summary-sidebar">
{$totalCount = 0}
{foreach $body.products as $item}
{$totalCount = $totalCount + $item.pieces}
{/foreach}
{block "sidebar-title"}
<p class="title-default"{if $body.products|count > 5} data-opener="[data-summary-sidebar-products]"{/if}>{t}Shrnutí{/t}
{if $body.stepName == 'cart'}
<span data-cart-voucher>
<a href="" data-voucher-show>{t}Vložit slevový kód{/t}</a>
</span>
{else}
<span>{$totalCount}&nbsp{t}ks{/t}</span>
{/if}
</p>
{if $body.stepName == 'cart'}
{include "ordering/ordering.voucher.tpl" hidden=true}
{/if}
{/block}
{block "user-manager-select"}
{ifmodule USER_MANAGER}
{if $ctrl.logged and $body.stepName == 'cart'}
{$users_select_title = "{t}Vyberte pobočku{/t}"}
{user_manager_insert_users_select title=$users_select_title activeOnly=true}
{/if}
{/ifmodule}
{/block}
{if $body.stepName != 'cart'}
{block "sidebar-products"}
<div {if $body.products|count > 5}data-summary-sidebar-products data-simplebar data-simplebar-auto-hide="false"{/if}>
<div class="summary-sidebar-productlist">
<div class="summary-sidebar-productlist-inner">
{if $body.products}
{include "ordering/ordering.summary.products.tpl" items=$body.products|array_reverse}
{else}
<p class="no-items">{t}V košíku nemáte žádné zboží.{/t}</p>
{/if}
</div>
</div>
</div>
{/block}
{/if}
{block "sidebar-delivery"}
{if $deliveryType}
<div class="summary-sidebar-delivery-wrapper">
{$delivery = $deliveryType->getDelivery()}
<div class="summary-sidebar-delivery">
{if $delivery}
{get_deliveries_dates cart=$body assign='deliveriesDates'}
{$date = $deliveriesDates[$delivery.id].date}
<p class="title">
{$delivery.name}
{if $date and $delivery->isInPerson()}
<br>
<span class="info">{t escape=false}k&nbsp;vyzvednutí{/t} {$date|format_date_locale_pretty:'d. L. Y'}</span>
{elseif $date}
<br>
<span class="info">{t}předpokládané doručení{/t} {$date|format_date_locale_pretty:'d. L. Y'}</span>
{/if}
</p>
<p class="price">
{$delivery.price.value_with_vat|format_price}
</p>
{/if}
</div>
{$payment = $deliveryType->getPayment()}
<div class="summary-sidebar-delivery">
<p class="title">
{if $payment}
{$method = $payment->getSelectedMethod()}
{if $method}
{$method.name nofilter}
{else}
{$payment->getName() nofilter}
{/if}
{else}
{$deliveryType->payment}
{/if}
</p>
<p class="price">
{$paymentPrice = $view->getPaymentPrice($payment.id)}
{if $paymentPrice != null}
{if $paymentPrice.value_with_vat->isPositive()}
{$paymentPrice.value_with_vat|format_price}
{else}
{t}zdarma{/t}
{/if}
{/if}
</p>
</div>
</div>
{/if}
{/block}
<div class="summary-sidebar-inner">
{block "sidebar-pricebox"}
{include "ordering/ordering.pricebox.tpl" transport=($body.stepName != 'cart')}
{if $isLastStep}
{ifmodule AGE_VERIFY}
{if $dbcfg.age_verify.adulto.enabled}
<div class="adulto-cz" data-sitekey="{$dbcfg.age_verify.adulto.public_key}"></div>
<input type="hidden" name="customer_age" value="18" data-adultocz="customer_age">
{/if}
{/ifmodule}
<p class="check-order-msg">{t}Překontrolujte si košík a odešlete objednávku.{/t}</p>
{/if}
{if $tpl_vars.btns_in_sidebar}
{include "ordering/ordering.btns.sidebar.tpl" showVoucher=false}
{/if}
{/block}
</div>
</div>
{block "js-dynamic-load" append}
{ifmodule AGE_VERIFY}
{if $dbcfg.age_verify.adulto.enabled}
<script async src="https://api.js.m2a.cz/api.js"></script>
{/if}
{/ifmodule}
{/block}