{* Newsletter product block template Variables available: - $products - Array of SafeProduct objects - $webshop - SafeWebshop object - $currency - Currency symbol (e.g. "DKK") - $max_products - Number of products to show - $per_row - Number of products per row (default 3) - $show_price - Bool, vis pris (default true) - $show_button - Bool, vis knap (default false) - $button_text - Knaptekst (default "Se produkt") - $button_bg_color - Knap baggrundsfarve - $button_text_color - Knap tekstfarve Customize this template to match your newsletter design. Note: Use inline styles for email compatibility. *}> <{$cols = $per_row|default:3}> <{* Beregn kolonnebredde baseret på antal kolonner *}> <{if $cols == 2}> <{$col_width = 50}> <{elseif $cols == 4}> <{$col_width = 25}> <{else}> <{$col_width = 33}> <{/if}> <{* Hvis templaten kaldes fra ældre platform-kode uden show_price, antag true (bagudkompatibelt) *}> <{if !isset($show_price)}> <{$show_price = true}> <{/if}>
|
<{if $image}>
<{$product->getName()|escape}>
<{if $show_price}>
<{if $product->getSalePrice()}>
<{$product->getPrice()|number_format:2:$webshop->getDecimalSeparator(","):$webshop->getThousandSeparator(".")}> <{$currency}>
<{$real_price|number_format:2:$webshop->getDecimalSeparator(","):$webshop->getThousandSeparator(".")}> <{$currency}>
<{else}>
<{$real_price|number_format:2:$webshop->getDecimalSeparator(","):$webshop->getThousandSeparator(".")}> <{$currency}>
<{/if}>
<{/if}>
<{if $show_button}>
<{$button_text|default:'Se produkt'|escape}>
<{/if}>
|
<{/foreach}>
<{* Fyld sidste række med tomme celler *}>
<{$remaining = $products|@count % $cols}>
<{if $remaining > 0}>
<{for $i = $remaining to $cols - 1}>
<{/for}> <{/if}> |