Files
kupshop/web/templates/kupkolo/orderView.tpl
2025-08-02 16:30:27 +02:00

319 lines
14 KiB
Smarty

{extends "index.tpl"}
{block "css-entry" append}
{encore_entry_link_tags entry='cart'}
{/block}
{block content}
{change_currency currency=$body.order->currency}
<div class="page-orderview">
<div class="row">
{block "order-header"}
<div class="col-sm-6">
<h1 class="text-left">{t}Objednávka{/t}{if $body.order.order_no}: {$body.order.order_no}{/if}</h1>
</div>
{/block}
</div>
{include "block.messages.tpl"}
{if $body.error != ''}
<div class="alert alert-info" role="alert">
{$body.error nofilter}
</div>
{/if}
{block "order-payment"}
{if $body.payment && $body.payment->hasOnlinePayment() && $body.order->isActive() && !$body.order->isPaid()}
{$body.payment->getOrderViewDescription() nofilter}
{/if}
{/block}
<div class="orderViewSummary">
<table class="table table-cart">
<tr>
<th>{t}Datum objednání{/t}</th>
<th>{t}Stav objednávky{/t}</th>
</tr>
<tr>
<td>{$body.order.date_created|date_format:"%d.%m.%Y %H:%M"}</td>
<td>
{if $body.order.status_storno}
{t}Objednávka stornována{/t}
{else}
{if !$body.editable}
{$body.order.status_text}
{else}
Zpracování pozastaveno!
<br>
Čeká se na potvrzení změn
{/if}
{/if}
</td>
</tr>
</table>
<hr>
</div>
<div class="orderViewSummary">
{block "address"}
<div class="row">
<div class="col-md-4 col-lg-4">
<h3 class="form-title">{t}Kontaktní údaje{/t}</h3>
<ul class="summary-list">
<li><strong>{$body.order.invoice_name} {$body.order.invoice_surname}</strong></li>
<li>{$body.order.invoice_email}</li>
<li>{$body.order.invoice_phone}</li>
</ul>
</div>
{if $body.order.invoice_street || $body.order.invoice_city || $body.order.invoice_zip}
<div class="col-md-4 col-lg-4">
<h3 class="form-title">{t}Fakturační adresa{/t}</h3>
<ul class="summary-list">
{if $body.order.invoice_firm}
<li>{$body.order.invoice_firm}</li>
{else}
<li>{$body.order.invoice_name} {$body.order.invoice_surname}</li>
{/if}
<li>{$body.order.invoice_street}</li>
{if $body.order.invoice_custom_address}
<li>{$body.order.invoice_custom_address}</li>
{/if}
<li>{$body.order.invoice_zip} {$body.order.invoice_city}</li>
{if $body.order.invoice_state}
<li>{$body.order.invoice_state}</li>
{/if}
<li>{$cfg.Order.Countries[$body.order.invoice_country]}</li>
{if $body.order.invoice_ico}
<li>{t}IČO{/t}: {$body.order.invoice_ico}</li>
{/if}
{if $body.order.invoice_dic}
<li>{t}DIČ{/t}: {$body.order.invoice_dic}</li>
{/if}
</ul>
</div>
{/if}
{if $body.order.delivery_name || $body.order.delivery_surname || $body.order.delivery_street}
<div class="col-md-4">
<h3 class="form-title">{t}Dodací adresa{/t}</h3>
<ul class="summary-list">
<li>{$body.order.delivery_name} {$body.order.delivery_surname}</li>
{if $body.order.delivery_firm && $body.order.delivery_firm != $body.order.delivery_name|cat:" "|cat:$body.order.delivery_surname}
<li>{$body.order.delivery_firm}</li>
{/if}
<li>{$body.order.delivery_street}</li>
{if $body.order.delivery_custom_address}
<li>{$body.order.delivery_custom_address}</li>
{/if}
<li>{$body.order.delivery_zip} {$body.order.delivery_city}</li>
{if $body.order.delivery_state}
<li>{$body.order.delivery_state}</li>
{/if}
<li>{$cfg.Order.Countries[$body.order.delivery_country]}</li>
{if $body.order.delivery_phone}
<li>{$body.order.delivery_phone}</li>
{/if}
</ul>
</div>
{/if}
</div>
<hr>
{/block}
{$deliveryType = $body.order->getDeliveryType()}
{if $deliveryType}
<div class="row">
<div class="col-md-12">
<h3>{t}Doprava a platba{/t}</h3>
{block "delivery"}
<ul class="summary-list">
<li>{$deliveryType->delivery}</li>
{$delivery = $deliveryType->getDelivery()}
{if $delivery}
<li>{$delivery->printDeliveryInfo() nofilter}</li>
{/if}
{block "payment-class"}
{$payment = $deliveryType->getPayment()}
{if $payment}
<li>{$payment->getName() nofilter} </li>
{/if}
{/block}
</ul>
{/block}
</div>
</div>
<hr>
{/if}
{if $body.order.note_user}
<h2>{t}Poznámka k objednávce{/t}</h2>
<p>{$body.order.note_user|escape:'htmlall'|nl2br nofilter}</p>
<hr>
{/if}
{if $body.order.noteAdmin}
<h2>{t}Poznámka pro zákazníka{/t}</h2>
<p>{$body.order.noteAdmin}</p>
<hr>
{/if}
{block "bonus-points"}{/block}
{block "wtf-products"}
{block "products"}
<h3>{t}Objednané zboží{/t}</h3>
<div class="table-cart">
{$cf = $body.order->getSecurityCode()}
{get_order_coupons order=$body.order assign='order_coupons'}
{foreach $body.order.items as $product}
<div class="product">
<div class="product-inner display-table" data-cart="row">
<div class="col-xs-1 product-image text-center">
{if $product.id_product}
<a title="{t}Zobrazit zboží{/t}" href="{url s=product IDproduct=$product.id_product TITLE=$product.descr}">
<img src="{get_photo photo=$product.photo size=2}" alt="{$product.descr}" class="img-responsive">
</a>
{else}
<img src="{get_photo photo=$product.photo size=2}" alt="" class="img-responsive">
{/if}
</div>
{block "cart-title"}
<div class="col-xs-3 product-title">
{if $product.id_product}
<a title="{t}Zobrazit zboží{/t}" href="{url s=product IDproduct=$product.id_product TITLE=$product.descr}">{$product.descr}</a>
{else}
{$product.descr}
{/if}
{* pozor, stary produkty maji .note ale ne .product *}
{if $product.product and $product.note}
{block "product-notes"}
{$itemInfo = $body.order->getItemInfo($product)}
{foreach $itemInfo as $key => $print_note}
<div class="small">{$print_note nofilter}</div>
{/foreach}
{/block}
{/if}
{if !empty($order_coupons[$product.id])}
<br>Kód:
{foreach $order_coupons[$product.id] as $coupon}
{$coupon_url = path('kupshop_orderingbundle_pdfcoupon', ['id_order' => $body.order.id, 'id_coupon' => $coupon.id, 'cf' => $cf], 0)}
<a href="{$coupon_url}" target="_blank">{$coupon.code}</a>{if !$coupon@last},{/if}
{/foreach}
{/if}
</div>
{/block}
{block "product-pieces"}
<div class="col-xs-2 product-pieces">
{if $product.id_product}
{$product.pieces}
{if $module.PRODUCTS__UNITS}
{$product.product.unit.short_name|lower}
{else}
{t}Ks{/t}
{/if}
{/if}
</div>
{/block}
{block "product-price"}
<div class="col-xs-2 product-price-total">
{$product.total_price.value_with_vat|format_price:"ceil=no;decimal=dynamic"}
</div>
{/block}
</div>
</div>
{/foreach}
</div>
{/block}
{/block}
{block "discounts"}
{get_order_items_discounts order=$body.order assign='itemsDiscounts'}
{if $itemsDiscounts}
<div class="row">
<div class="col-xs-12">
<h3>* {t}Aplikované slevy{/t}</h3>
<table class="table discounts-list">
{$totalDiscounts = DecimalConstants::zero()}
{foreach $itemsDiscounts as $discount}
<tr>
<td>{$discount.name}</td>
<td><span class="pull-right">{$discount.totalPrice|format_price:"ceil=no;decimal=dynamic"}</span></td>
</tr>
{$totalDiscounts = $totalDiscounts->add($discount.totalPrice)}
{/foreach}
<tr>
<td class="strong">{t}Celkem jste ušetřili{/t}</td>
<td class="strong"><span class="pull-right">{$totalDiscounts|format_price:"ceil=no;decimal=dynamic"}</span>
</td>
</tr>
</table>
</div>
</div>
{/if}
{/block}
{block "wtf"}
{block "price"}
<div class="row cart-row">
<div class="col-sm-6 col-xs-12 pull-right">
<div class="price-box">
{if $dbcfg.shop_vat_payer}
<div class="row price-with-vat">
<div class="col-xs-6">
<p>{t}Cena bez DPH{/t}:</p>
</div>
<div class="col-xs-6 text-right">
<p>{$body.order.total_price_array.value_without_vat|format_price:"ceil=no;decimal=dynamic"}</p>
</div>
</div>
{/if}
<div class="row">
<div class="col-xs-6">
<p class="total-price">{t}Cena celkem{/t}:</p>
</div>
<div class="col-xs-6 text-right">
<h3>{$body.order.total_price_array.value_with_vat|format_price:"ceil=no;decimal=dynamic"}</h3>
</div>
</div>
</div>
</div>
</div>
{/block}
{/block}
{block "history"}
<hr>
<h3 class="form-title">{t}Historie objednávky{/t}</h3>
<table class="table table-cart">
<tr>
<th>{t}Datum{/t}</th>
<th>{t}Stav{/t}</th>
<th>{t}Poznámka{/t}</th>
</tr>
{foreach $body.order->getHistory() as $history}
<tr>
<td>{$history.date|date_format:"%d.%m.%Y %H:%M:%S"}</td>
<td>{$view.orderInfo->getOrderStatus($history.id_status)}</td>
<td>{$history.comment nofilter}</td>
</tr>
{/foreach}
</table>
{/block}
</div>
</div>
{/change_currency}
{/block}