51 lines
2.3 KiB
Smarty
51 lines
2.3 KiB
Smarty
{block 'cart-messages'}
|
|
{get_session_value type='user_messages' assign='messages'}
|
|
<div data-reload="messages">
|
|
{strip}
|
|
<div class="alert-wrapper cart-messages">
|
|
{foreach $messages as $message}
|
|
<div class="alert alert-{$message.severity} {$message.class} {$message.id}">
|
|
{if $message.id == 'outOfStock'}
|
|
{if $body.products|count and $message.products|count > 1}
|
|
{$message.products|count}
|
|
{t plural="produkty nejsou v požadovaném množství skladem" plural5="produktů není v požadovaném množství skladem" count=$message.products|count}produkt není v požadovaném množství skladem{/t}:
|
|
<ul>
|
|
{$cart_products = array_column($body.products, 'title', 'id')}
|
|
{foreach $message.products as $id => $variation}
|
|
{if array_key_exists($id, $cart_products)}
|
|
<li>{$cart_products[$id]}</li>
|
|
{/if}
|
|
{/foreach}
|
|
</ul>
|
|
{else}
|
|
{$message.text nofilter}
|
|
{/if}
|
|
{if $dbcfg->order_not_in_store == 'N'}
|
|
<hr>
|
|
<a href="?act=fixOutOfStock" {if $tpl_vars.custom_stock_btn}class="fix" {else}class="btn btn-secondary btn-sm"
|
|
style="text-decoration: none;"{/if}
|
|
title="{t}Automaticky snížit počet nedostupných položek podle aktuálních skladových zásob.{/t}">
|
|
{t}Upravit položky dle aktuálních skladových zásob{/t}
|
|
</a>
|
|
{/if}
|
|
{else}
|
|
{$message.text nofilter}
|
|
{/if}
|
|
</div>
|
|
{/foreach}
|
|
</div>
|
|
{/strip}
|
|
</div>
|
|
{/block}
|
|
|
|
{* todo predelat na usermessage a smazat *}
|
|
<div {if $body.stepName == 'cart'}data-reload="cart-error"{/if}>
|
|
{if $body.error}
|
|
<div class="alert {if $body.error_id == 4}alert-success{else}alert-danger{/if}" role="alert">
|
|
{$body.error nofilter}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
{block 'custom-message-cart'}{/block}
|