33 lines
1.3 KiB
Smarty
33 lines
1.3 KiB
Smarty
{$gifts = $body->getPurchaseState()->getCustomData('gift')}
|
|
{$selected_products = []}
|
|
{foreach $gifts as $discountId => $selectedGifts}
|
|
{$tmp_selected = array_filter(array_column($selectedGifts, 'id_product'))}
|
|
{if $tmp_selected}
|
|
{$selected_products = array_merge($selected_products, $tmp_selected)}
|
|
{/if}
|
|
{/foreach}
|
|
|
|
{* zobrazi se na souhrnu objednávky *}
|
|
{if $summary && $selected_products}
|
|
<h3 class="m-y-2">{t}Dárek k objednávce zdarma{/t}:</h3>
|
|
<div class="row cart-discount-row">
|
|
{foreach $body->getPurchaseState()->getDiscountHandlers() as $handler}
|
|
{$data = $handler->getData()}
|
|
{$gift = $data['gift']}
|
|
{if $gift && in_array($gift, $selected_products)}
|
|
{$vars = $handler->getVars()}
|
|
{$product = $vars['products'][$gift]}
|
|
{if $product}
|
|
{$product->fetchImages(4)}
|
|
<div class="col-xs-12 col-sm-6 col-lg-4">
|
|
<div class="cart-discount-item">
|
|
<img src="{get_photo photo=$product.image size=4}" alt="{$product.title}" class="img-responsive">
|
|
<span class="discount-title">{$product.title}</span>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
{/if}
|