167 lines
7.2 KiB
Smarty
167 lines
7.2 KiB
Smarty
{extends "ordering.tpl"}
|
|
|
|
{function delivery_row}
|
|
{block "delivery-row"}
|
|
<div class="delivery-item display-row {if $delivery.exception}disabled{/if}" data-cart="item">
|
|
<div class="display-cell">
|
|
<label class="custom-radio custom-control c-input c-radio" for="del{$id}">
|
|
<input type="radio" name="delivery_id" value="{$id}" id="del{$id}" class="custom-control-input"
|
|
{if !$delivery.exception and ($body.delivery_id == $id)}checked{/if}
|
|
{if $delivery.exception}disabled{/if}>
|
|
<span class="custom-control-indicator c-indicator"></span>
|
|
{photo photo=$delivery.photo}
|
|
<p>{$delivery.name}
|
|
<small>
|
|
{if $delivery.exception}
|
|
{$delivery.exception->getShortMessage()}
|
|
{elseif $availability == 1}
|
|
{$date = $delivery->getDeliveryDate()}
|
|
{if $date}
|
|
{if $delivery->isInPerson()}
|
|
{t datum=$date|format_date_pretty}K vyzvednutí {datum}{/t}
|
|
{else}
|
|
{t datum=$date|format_date_pretty}Doručíme {datum}{/t}
|
|
{/if}
|
|
{/if}
|
|
{/if}
|
|
</small>
|
|
</p>
|
|
|
|
{$templateDescription = $delivery->getCartDescription()} {* vlastni sablona v enginu *}
|
|
{$customDescription = $delivery->cart_description} {* vlastni popis z adminu *}
|
|
|
|
{if $templateDescription or $customDescription}
|
|
<div class="delivery_description" id="delivery_description_{$delivery.id}" style="display:none">
|
|
{if $templateDescription}
|
|
{$templateDescription nofilter}
|
|
{elseif $customDescription}
|
|
{$customDescription nofilter}
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
</label>
|
|
</div>
|
|
|
|
<div class="display-cell delivery-price">
|
|
{$deliveryPrice = $view->getDeliveryPrice($id)}
|
|
{if $delivery.exception}
|
|
{* nic *}
|
|
{else}
|
|
{$deliveryPrice.value_with_vat|format_price}
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{/function}
|
|
|
|
{block "order-content"}
|
|
<div class="row deliveries" data-cart="delivery">
|
|
<div class="col-md-6 col-xs-12">
|
|
<h1 class="h2">{t}Doprava{/t}</h1>
|
|
<div class="cart-box display-table post">
|
|
{$availability = $body->getAvailability()}
|
|
|
|
{$deliveries = $body->getDeliveries()}
|
|
{foreach $deliveries as $id => $delivery}
|
|
{if $delivery->isInPerson()}
|
|
{* to avoid needless looping if there is no inperson delivery choice*}
|
|
{$inpersonExists = true}
|
|
{else}
|
|
{delivery_row delivery=$delivery id=$id}
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
{block "cart-currency-switch"}
|
|
{/block}
|
|
{block 'cart-inperson'}
|
|
{if $inpersonExists == true}
|
|
<h2>{t}Osobní odběr{/t}</h2>
|
|
<div class="cart-box display-table">
|
|
{foreach $deliveries as $id => $delivery}
|
|
{if $delivery->isInPerson()}
|
|
{delivery_row delivery=$delivery id=$id inperson=true}
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
</div>
|
|
|
|
{block "cart-payments"}
|
|
<div class="col-md-6 col-xs-12">
|
|
<h2>{t}Platba{/t}</h2>
|
|
<div class="cart-box display-table" data-reload="payment">
|
|
|
|
{$payments = $body->getPayments()}
|
|
|
|
{foreach $payments as $id => $payment}
|
|
{if !$payment.class or !$payment.class->hasCartTemplate()}
|
|
<div class="payment-item display-row {if $payment.disabled}disabled{/if}" data-cart="item">
|
|
<div class="display-cell">
|
|
<label class="custom-radio custom-control c-input c-radio">
|
|
<input type="radio" name="payment_id" value="{$id}"
|
|
class="custom-control-input" {$body.payment_id|checked:$id nofilter}
|
|
{if $payment.disabled}disabled{/if}>
|
|
<span class="custom-control-indicator c-indicator"></span>
|
|
<span class="delivery-photo">
|
|
{if $payment.class.class == "OmnipayNestpay"}
|
|
<img src="/static/images/card{$ctrl.active_language|upper}.jpg" alt="">
|
|
{else}
|
|
{photo photo=$payment.photo}
|
|
{/if}
|
|
</span>
|
|
{block "payment-name"}
|
|
<span class="nowrap">{$payment.name}</span>
|
|
{/block}
|
|
</label>
|
|
</div>
|
|
<div class="display-cell delivery-price text-right">
|
|
{$paymentPrice = $view->getPaymentPrice($id)}
|
|
{$paymentPrice.value_with_vat|format_price}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
|
|
{insert_page code="poznamka_platba" exists='exists' assign='no_cod_exists'}
|
|
|
|
{if $no_cod_exists}
|
|
{$no_cod_exists.content nofilter}
|
|
{/if}
|
|
|
|
{block "online-payments"}
|
|
{foreach $payments as $id => $payment}
|
|
{if $payment.class and $payment.class->hasCartTemplate()}
|
|
<h2>{photo photo=$payment.photo} {$payment.name}</h2>
|
|
<div class="cart-box thepay-method display-table payment-{$payment.class.class|strip_accent|lower}">
|
|
{if $payment.class->hasCartTitle()}
|
|
{get_smarty assign='smarty_object'}
|
|
{$payment.class->getCartTitle($smarty_object) nofilter}
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
{/foreach}
|
|
{/block}
|
|
</div>
|
|
{/block}
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-6 pull-right">
|
|
{showPriceBox transport=1}
|
|
</div>
|
|
</div>
|
|
{block 'cart-buttons'}
|
|
{cartBtns submitName='OrderNext' valueNext='user'}
|
|
{/block}
|
|
{/block}
|
|
|
|
{block "js-dynamic-load" append}
|
|
{$unique_deliveries = $deliveries|array_unique}
|
|
{get_smarty assign='smarty_object'}
|
|
|
|
{foreach $unique_deliveries as $id => $delivery}
|
|
{$delivery->getInitTemplate($smarty_object)}
|
|
{/foreach}
|
|
{/block}
|