{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} {# Valeurs par défaut (pour éviter les erreurs si aucune variante) #} {% set has_discount = false %} {% set price = null %} {% set original_price = null %} {% set applied_promotions = [] %} {% if not product.enabledVariants.empty() %} {% set variant = product|sylius_resolve_variant %} {% if variant is not null %} {% set has_discount = variant|sylius_has_discount({'channel': sylius.channel}) %} {% set price = money.calculatePrice(variant) %} {% set original_price = money.calculate_original_price(variant) %} {% set applied_promotions = variant.getappliedPromotionsForChannel(sylius.channel) %} {% endif %} {% endif %}
{# Badge si promo / réduction #} {% if has_discount %} Promo {% endif %} {# Lien vers la page produit #}
{% if product.images|length > 0 %} {{ product.name|e }} {% endif %}
{# Bloc d’effet d’animation #}
{# Nom du produit #} {# Prix (incluant logiques de promotion / stock) via ton fragment #}
{% include '@SyliusShop/Product/Box/_price.html.twig' with {'product': product} %}
{# Exemple d’options (taille, couleur, etc.) si tu en as besoin #} {#
+2 colors
#}