{% import '@RiccardoTheme/storefront/rz/flavor.html.twig' as rz %} {# # Deal-Karte. Erwartet: item = { deal, product, dealPrice, regularPrice } #} {% set deal = item.deal %} {% set product = item.product %} {% set cf = product.translated.customFields|default({}) %} {% set rdColor = cf.rz_color is defined and cf.rz_color ? cf.rz_color : '' %} {% set rdLabel = deal.qualifyingLabel ?: ('riccardoDeals.defaultLabel'|trans) %} {% set rdUrl = seoUrl('frontend.detail.page', { productId: product.id }) %} {# gleiche Namensaufteilung wie auf den Produktkarten: 0 = Marke, 1 = Name, 2 = Zusatz #} {% set rdName = rz.nameParts(product, false)|split('|') %} {% set rdParts = rdName|slice(1)|filter(v => v) %} {% set rdSaving = item.regularPrice - item.dealPrice %}
{{ deal.badge ?: ('riccardoDeals.badge'|trans) }} {% if deal.validUntil %} bis {{ deal.validUntil|format_datetime(pattern: "EEE, dd.MM., HH:mm 'Uhr'", locale: 'de', timezone: 'Europe/Berlin') }} {% endif %}
{% if product.cover.media %} {% sw_thumbnails 'rd-deal-image' with { media: product.cover.media, sizes: { default: '360px' }, attributes: { class: 'rd-deal-img', alt: product.translated.name, loading: 'lazy' } } %} {% endif %}
{{ rdName|first }}

{{ rdParts|first }}

{% if rdParts|length > 1 %}{{ rdParts|slice(1)|join(' · ') }}{% endif %}
{{ item.dealPrice|currency }} {{ item.regularPrice|currency }} {% if rdSaving > 0 %}du sparst {{ rdSaving|currency }}{% endif %}

ab {{ deal.minQualifyingValue|currency }} aus {{ rdLabel }} im Warenkorb{% if deal.minMargin %}*{% endif %}

{% sw_include '@Storefront/storefront/component/product/card/action.html.twig' with { product: product } %}