{$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} {if $selected_products} {foreach $body->getPurchaseState()->getDiscountHandlers() as $handler} {$data = $handler->getData()} {* Pokud jsou varianty, `id_product` je id produktu a `gift` je id varianty. Bez variant je jen `gift` = id produktu. *} {$gift = $data['id_product']|default:$data['gift']} {if $gift and in_array($gift, $selected_products)} {$vars = $handler->getVars()} {$product = $vars['products'][$gift]} {if $product} {$product->fetchImages(4)}
{$photo_dimensions = $cfg.Photo.types['product_cart'].size} {$product.title}
{$product.title} {$vars.title|default:"{t}Dárek zdarma{/t}"}

{if $vars.price && $vars.price->getPriceWithVat()->isZero() and !$tpl_vars.gift_show_price}{t}zdarma{/t}{else}{$vars.price|format_price}{/if}

 

{/if} {/if} {/foreach} {/if}