99 lines
4.6 KiB
Smarty
99 lines
4.6 KiB
Smarty
{if !$product}
|
|
{$product = $body.product}
|
|
{/if}
|
|
|
|
{$step = 1}
|
|
|
|
{ifmodule PRODUCTS__STEP}
|
|
{if $product.data.step > 0}
|
|
{$data = $product.data}
|
|
{$step = json_decode($product.data.step, true)}
|
|
{else}
|
|
{$data = json_decode($product.product.data, true)}
|
|
{$step = $data.step|default:$step}
|
|
{/if}
|
|
{/ifmodule}
|
|
|
|
<form action="{url s=cart}" method="get" data-buy-form>
|
|
<input type="hidden" name="act" value="add">
|
|
<input type="hidden" name="redir" value="1">
|
|
<input type="hidden" name="IDproduct" value="{$body.product.id}">
|
|
|
|
<div data-variations="b2b-variations">
|
|
<div class="variations-b2b-table-wrapper">
|
|
<table class="variations-b2b-table">
|
|
<tr>
|
|
<th>{t}Varianta{/t}</th>
|
|
<th>{t}Skladem{/t}</th>
|
|
<th class="text-right b2b-price">{t}MOC s DPH{/t}</th>
|
|
<th class="text-right b2b-price">{t}B2B bez DPH{/t}</th>
|
|
<th class="text-right">{t}Do košíku{/t}</th>
|
|
</tr>
|
|
{$isAnyVariationAvailable = false}
|
|
{foreach $body.product.variations.variations as $variation}
|
|
{calc_product_discount product=$body.product variation=$variation assign='discount'}
|
|
<tr>
|
|
<td>
|
|
<strong>{$variation.title}</strong>
|
|
{if $variation.code}<small>{$variation.code}</small>{/if}
|
|
</td>
|
|
<td {if $variation.in_store > 0} class="delivery-0"{/if}>{$variation.in_store} {t}ks{/t}</td>
|
|
<td class="text-right b2b-price">
|
|
{if $discount.retailPrice}
|
|
{$discount.retailPrice|format_price}
|
|
{/if}
|
|
</td>
|
|
<td class="text-right b2b-price"><strong>{$variation.productPrice.value_without_vat|format_price}</strong></td>
|
|
<td class="text-right">
|
|
<div class="submit-block">
|
|
{product_can_buy product=$body.product id_variation=$variation.id assign='canBuy'}
|
|
{if $canBuy && $variation.in_store > 0}
|
|
{$isAnyVariationAvailable = true}
|
|
<input type="hidden" name="items[{$variation.id}][id_variation]" value="{$variation.id}">
|
|
<div class="buy-count-wrapper">
|
|
<input class="form-control" type="number" name="items[{$variation.id}][pieces]" title="{t}Počet kusů{/t}" value="0"
|
|
max="{$variation.in_store}" min="0" data-pieces-b2b>
|
|
<div class="buy_count">
|
|
<button type="button" class="fc icons_caret-up plus_unit"
|
|
title="{t mnozstvi=$step}Přidat {mnozstvi} ks{/t}"></button>
|
|
<button type="button" class="fc icons_caret-down minus_unit"
|
|
title="{t mnozstvi=$step}Odebrat {mnozstvi} ks{/t}"></button>
|
|
</div>
|
|
</div>
|
|
{else}
|
|
{ifmodule WATCHDOG}
|
|
<div data-reload="ajax-watchdog-{$body.product.id}-{$variation.id}">
|
|
{get_product_info type='is_watchdog' product=$body.product id_variation=$variation.id assign='is_watchdog'}
|
|
{if !$is_watchdog}
|
|
<a class="btn btn-block btn-secondary" href="{path('kupshop_watchdog_watchdog_add', ['id_product' => $body.product.id, 'id_variation' => $variation.id])}" data-ajax-watchdog>{t}Hlídat{/t}</a>
|
|
{else}
|
|
<a class="btn btn-block btn-secondary" href="{path('kupshop_watchdog_watchdog_remove', ['id_product' => $body.product.id, 'id_variation' => $variation.id, 'availability' => 1])}" data-ajax-watchdog>{t}Zrušit{/t}</a>
|
|
{/if}
|
|
</div>
|
|
{/ifmodule}
|
|
{/if}
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{block "submit-btn-b2b"}
|
|
{if $isAnyVariationAvailable}
|
|
<div class="submit-wrapper-b2b">
|
|
<p class="submit-total">
|
|
{t}Celkem ks{/t}: <span data-pieces-total-b2b>0</span>
|
|
</p>
|
|
|
|
{include 'product/product.submit-block.tpl' hide_buycount=1 submit_text="{t}Přidat vybrané do košíku{/t}"}
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
</form>
|
|
|
|
|
|
|