{% set hasDecli = produit.produitDeclinationValues|length > 0 %} {% set hasPromo = produit.promotion and date(produit.promotion.startAt) <= date() and date(produit.promotion.endAt) >= date() %} {% if hasPromo %} {% set discount = produit.promotion.discountValue %} {% set price_ttc = produit.priceTtc %} {% set price_remise = price_ttc - (produit.promotion.discountType == 'percent' ? price_ttc * discount / 100 : discount) %} {% endif %}
Référence

{{ produit.reference }}

{% if hasDecli %} Décliné {% endif %} {% if hasPromo %} En promotion {% endif %}
{{ produit.name }}
{% if hasPromo %}
{{ price_ttc|number_format(3, '.', ',') }} TND {{ price_remise|number_format(3, '.', ',') }} TND -{{ discount }}{% if produit.promotion.discountType == 'percent' %}%{% else %} TND{% endif %}
{% else %}
{{ produit.priceTtc|number_format(3, '.', ',') }} TND
{% endif %}
{% if is_granted('ROLE_SUPER_ADMIN') %}
{% if produit.supplierReference %} {{ produit.supplierReference }} - {% endif %} {% if produit.supplier %} {{ produit.supplier.name }} {% else %} - {% endif %}
{% endif %}
{% set principaleTrouvee = false %} {% for item in produit.picture %} {% if item.isSelected %}
Image principale
{% set principaleTrouvee = true %} {% endif %} {% endfor %} {% if not principaleTrouvee %}
Aucune image principale
{% endif %}
{% set array = [] %} {% for produitDeclination in produit.produitDeclinationValues %} {% for image in produitDeclination.picture %} {% for groupValue in produitDeclination.groupDeclinationValues %} {% if groupValue.declination.position == 1 and groupValue.value.name not in array %} {% set array = array|merge([groupValue.value.name]) %} {{ groupValue.value.name }} {{ groupValue.value.name }} {% endif %} {% endfor %} {% endfor %} {% endfor %}