232 lines
12 KiB
Smarty
232 lines
12 KiB
Smarty
{extends "ordering.tpl"}
|
|
|
|
{block "order-content"}
|
|
|
|
{block 'cart-free-delivery'}
|
|
{get_free_delivery assign='freeDelivery'}
|
|
{if $freeDelivery}
|
|
<div class="cart-free-shipping">
|
|
<p data-reload="free-shipping">
|
|
{if $freeDelivery->isPositive()}
|
|
{$totalPrice = $body->getTotalPriceForDelivery()->getPriceWithVat()}
|
|
{if $freeDelivery->lowerThanOrEqual($totalPrice) or $body.freeShipping == true}
|
|
<strong class="highlight">{t}Doprava zdarma{/t}!</strong>
|
|
{else}
|
|
{$freedeliveryvalue = $freeDelivery->sub($totalPrice)|format_price}
|
|
{t cenaZbyva=$freedeliveryvalue escape=false}Nakupte ještě za <strong class="nowrap">{cenaZbyva}</strong> <strong>a máte dopravu zdarma</strong>{/t}
|
|
{/if}
|
|
{elseif $freeDelivery->isZero() or $body.freeShipping == true}
|
|
<strong class="highlight">{t}Doprava zdarma{/t}!</strong>
|
|
{/if}
|
|
</p>
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
<div class="row cart-heading">
|
|
<div class="col-xs-12 {if !$ctrl.logged}col-md-6{/if}">
|
|
<h1 class="h2">{t}Produkty v košíku{/t}</h1>
|
|
</div>
|
|
|
|
{if !$ctrl.logged}
|
|
<div class="col-xs-12 col-md-6 text-right">
|
|
<p class="cart-signup">{t}Již u nás máte účet?{/t} <a href="{url s=login}" class="cart-signin">{t}Přihlaste se{/t}</a>.
|
|
<a href="{url s=user act=new}">{t}Registrace nového účtu{/t}</a>.
|
|
</p>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{block "cart-products-row"}
|
|
<div class="row">
|
|
<div class="col-xs-12 " data-reload="cart">
|
|
{if $body.products}
|
|
{split_partner_products products=$body.products assign=productGroups}
|
|
{* $productGroups contains array ['native' => $products, 'partner' => $products] *}
|
|
|
|
{if count($productGroups.partner) && count($productGroups.native)}
|
|
<div class="alert alert-warning" role="warning">
|
|
<p>{t}POZOR - Vaše objednávka bude rozdělena do dvou balíků, které vám budou doručeny samostatně{/t}</p>
|
|
</div>
|
|
{/if}
|
|
<div class="table-cart cart">
|
|
{if count($productGroups.partner) && count($productGroups.native)}
|
|
<div class="w-text">
|
|
<p class="text-big">{t}1. balík obsahuje:{/t}</p>
|
|
</div>
|
|
{/if}
|
|
{foreach $productGroups as $groupName => $groupProducts}
|
|
{if $groupName == 'partner' && count($groupProducts) && count($productGroups.native)}
|
|
{* partnerske produkty jsou vzdy druhe v poradi => obsah nize se vykresli pouze pokud existuji oba typy produktu *}
|
|
<div class="w-text m-t-2">
|
|
<p class="text-big">{t}2. balík obsahuje:{/t}</p>
|
|
</div>
|
|
{/if}
|
|
{foreach $groupProducts as $product}
|
|
<div class="product">
|
|
<div class="product-inner display-table" data-cart="row">
|
|
<div class="col-xs-1 product-image">
|
|
<a title="{t}Zobrazit zboží{/t}" href="{url s=product IDproduct=$product.id TITLE=$product.title}">
|
|
<img src="{get_photo photo=$product.image size=2}" alt="{$product.title}" class="img-responsive">
|
|
</a>
|
|
</div>
|
|
<div class="col-xs-2 text-center hidden-md-down">
|
|
{$gender = $product.sex}
|
|
{if $gender}
|
|
<div class="gender gender-cart">
|
|
{if $gender == 'W'}
|
|
<i class="fc icons_female" title="{t}Pro ženy{/t}"></i>
|
|
{elseif $gender == 'M'}
|
|
<i class="fc icons_male" title="{t}Pro muže{/t}"></i>
|
|
{elseif $gender == 'U'}
|
|
<i class="fc icons_unisex" title="{t}Unisex{/t}"></i>
|
|
{elseif $gender == 'K'}
|
|
<i class="fc icons_child-gender" title="{t}Pro děti{/t}"></i>
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
<div class="col-xs-3 product-title">
|
|
<a title="{t}Zobrazit zboží{/t}" href="{url s=product IDproduct=$product.id TITLE=$product.title}">{$product.product.descr|default:$product.product.model_section} {$product.product.model_short_title nofilter}</a>
|
|
{*
|
|
$product.availability rika, jestli jsou vsechny pozadovane kusy jedne polozky skladem.
|
|
$product.availability == 0 a $product.inStore == 1 znamena, ze je skladem jen cast pozadovanych kusu.
|
|
availability muze byt 0, 1 a 2
|
|
2 se pouzive pouze pokud je zpanuty modul sklad dodavatelu (napr KK).
|
|
Pozor, availability se muze upravit pomoci in_store_show_max
|
|
Pokud se neodecita ze skladu, availability je 1 pokud deliverytime je 0.
|
|
*}
|
|
|
|
{if $product.availability == 0 and $product.inStore == 0}
|
|
<p class="delivery delivery-notinstore">{$product.deliveryTimeText}</p>
|
|
{elseif $product.availability == 0 and $product.inStore > 0 }
|
|
<p class="delivery delivery-partly">{t pocet=$product.inStore}Skladem pouze {pocet} ks{/t}</p>
|
|
{elseif $product.availability == 1}
|
|
<p class="delivery delivery-instore">
|
|
{if $product.inStore > 10}
|
|
{t}Skladem více než 10 balení{/t}
|
|
{elseif $product.inStore < 4}
|
|
{t}Skladem 1-3 balení{/t}
|
|
{else}
|
|
{t}Skladem 4-10 balení{/t}
|
|
{/if}
|
|
</p>
|
|
{elseif $product.availability == 2}
|
|
{* ošklivost, ale $product.in_store_suppliers je tu vždy prázdné, asi je nemocný class.Cart *}
|
|
{$productInStoreSuppliers = $product.product->getInStoreSuppliers()}
|
|
{if $productInStoreSuppliers > 0}
|
|
<p class="delivery delivery-instore">
|
|
{if $productInStoreSuppliers > 10}
|
|
{t}Skladem více než 10 balení{/t}
|
|
{elseif $productInStoreSuppliers > 3}
|
|
{t}Skladem 4-10 balení{/t}
|
|
{else}
|
|
{t}Skladem 1-3 balení{/t}
|
|
{/if}
|
|
</p>
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
<div class="col-xs-1 product-price-per-piece">
|
|
{$product.price.value_with_vat|format_price} / {t}ks{/t}
|
|
</div>
|
|
<div class="col-xs-3 product-pieces">
|
|
<div class="submit-block">
|
|
<input type="number" min="1" name="products[{$product.idincart}][pieces]" value="{$product.pieces}" class="form-control" maxlength="3"
|
|
data-bv-excluded="true" data-cart="pieces" title="{t}Počet kusů{/t}">
|
|
<div class="buy_count">
|
|
<i class="fc icons_plus" data-cart="plus"></i>
|
|
<i class="fc icons_minus" data-cart="minus"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-1 product-price-total">
|
|
{$product.totalPrice.value_with_vat|format_price}
|
|
</div>
|
|
<div class="col-xs-1 product-delete">
|
|
<a href="{url s=cart act=erase IDInCart=$product.idincart}" title="{t}Odstranit produkt z košíku{/t}" data-cart="delete"><i
|
|
class="fc icons_close-lg"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/foreach}
|
|
{/foreach}
|
|
</div>
|
|
|
|
{* dárky, příplatky *}
|
|
{ifmodule ORDER_DISCOUNT}
|
|
{* sort handlers = [1 - gifts, 0 - charges] *}
|
|
{insert_discounts_actions cart=$body type='full' sort=[1, 0] assign='discountsActions'}
|
|
{foreach $discountsActions as $discountAction}
|
|
{$discountAction nofilter}
|
|
{/foreach}
|
|
{/ifmodule}
|
|
{else}
|
|
<p class="alert alert-info" role="alert">{t}Váš košík je prázdný :({/t}</p>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
|
|
{block "cart-priceboxes"}
|
|
<div class="row">
|
|
{* slevový kupón *}
|
|
{block 'cart-discount'}
|
|
<div class="col-lg-6 col-xs-12 cart-voucher">
|
|
{if $module.ORDER_DISCOUNT}
|
|
{$coupon = $body.coupons|reset}
|
|
{if $coupon}
|
|
<button class="btn btn-white" type="submit" name="DeleteDiscount" value="1">
|
|
<i class="fc icons_close-sm"></i> {t}Odebrat slevový kód {/t}<strong>{$coupon}</strong>
|
|
</button>
|
|
{else}
|
|
<span data-reload="discount"></span>
|
|
<p><i class="fc icons_arrow_right"></i> <a href="">{t}Uplatnit slevový kód{/t}</a></p>
|
|
<div>
|
|
<div class="input-group">
|
|
<input type="text" name="couponNo" id="couponNo" placeholder="{t}Slevový kód{/t}" value="{$coupon}" class="form-control">
|
|
<span class="input-group-btn">
|
|
<input class="btn btn-outlined" type="submit" name="AddDiscount" value="{t}Přidat slevu{/t}">
|
|
</span>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
|
|
<div class="col-lg-6 col-xs-12">
|
|
{showPriceBox transport=0}
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
|
|
{* tlačítka + informační text *}
|
|
{block 'cart-buttons'}
|
|
{cartBtns submitName='OrderNext' valueNext='delivery'}
|
|
{/block}
|
|
{/block}
|
|
|
|
<script>
|
|
{block onready append}
|
|
|
|
{block "voucher-js"}
|
|
$('.cart-voucher > p a').click(function() {
|
|
$(this).parents('p').fadeOut().siblings('div').fadeIn().find(':input').focus();
|
|
return false;
|
|
});
|
|
|
|
// disable voucher button when input is empty
|
|
var voucherBtn = $('.cart-voucher input.btn');
|
|
|
|
voucherBtn.prop('disabled', true);
|
|
$('#couponNo').keyup(function(e) {
|
|
voucherBtn.prop('disabled', this.value == '');
|
|
}).keydown(function(e) {
|
|
if (e.keyCode == 13)
|
|
voucherBtn.click();
|
|
});
|
|
|
|
{/block}
|
|
{/block}
|
|
</script>
|
|
|