{% set pricing = cart.pricing %}
{% set shipping = cart.cartShipping %}
{% set promos = cart.cartPromos ? cart.cartPromos.items : [] %}
{{ 'delivery.mail.intro'|trans({'%ref%': reference }, null, locale|default('fr')) }}

{{ 'delivery.mail.details_heading'|trans({}, null, locale|default('fr')) }}
{% if pricing and pricing.lines is not empty %}
{% for line in pricing.lines %}
- {{ line.productName }}{% if line.typeName or line.unitLabel %} - {{ line.typeName }}{% if line.unitLabel %}{% if line.typeName %} ({{ line.unitLabel }}){% else %}{{ line.unitLabel }}{% endif %}{% endif %}{% endif %}{% if line.optionName %} - {{ 'shop.option_label'|trans({}, null, locale|default('fr')) }} : {{ line.optionName }}{% if line.optionTotalTTC > 0 %} (+{{ line.optionTotalTTC|price_format }} €){% endif %}{% endif %} - {{ 'delivery.mail.quantity_short'|trans({}, null, locale|default('fr')) }}{{ line.quantity }} - {% if line.isPromoGift %}{{ 'shop.offered'|trans({}, null, locale|default('fr')) }}{% else %}{{ line.netTTC|price_format }} €{% endif %}{% if line.degressiveTTC > 0 %} ({{ 'shop.degressive'|trans({}, null, locale|default('fr'))|lower }} : -{{ line.degressiveTTC|price_format }} €){% endif %}
{% endfor %}
{% else %}
{{ 'delivery.mail.details_empty'|trans({}, null, locale|default('fr')) }}
{% endif %}

{{ 'delivery.mail.summary_heading'|trans({}, null, locale|default('fr')) }}
{{ 'checkout_design.subtotal'|trans({}, null, locale|default('fr')) }} : {% if pricing %}{{ pricing.subtotalTTC|price_format }} €{% else %}-{% endif %}
{% if pricing and pricing.degressiveTTC > 0 %}
{{ (pricing.degressiveIsBottleOffered ? 'shop.of_which_bottle_offered' : 'shop.of_which_degressive')|trans({}, null, locale|default('fr')) }} : -{{ pricing.degressiveTTC|price_format }} €
{% endif %}
{% for promo in promos %}
{% if promo.discountItemsTTC > 0 %}
{{ 'shop.discount'|trans({}, null, locale|default('fr')) }}{% if promo.code %} - {{ promo.code }}{% endif %}{% if promo.percent is not null %} - {{ (promo.percent * 100)|number_format(0, ',', ' ') }}%{% endif %} : -{{ promo.discountItemsTTC|price_format }} €
{% endif %}
{% endfor %}
{{ 'delivery.mail.delivery_label'|trans({}, null, locale|default('fr')) }} : {% if shipping is not null %}{{ shipping.amountTTC|price_format }} €{% if shipping.name %} ({{ shipping.name }}){% endif %}{% else %}-{% endif %}
{% for promo in promos %}
{% if promo.discountShippingTTC > 0 %}
{{ 'shop.discount_shipping'|trans({}, null, locale|default('fr')) }}{% if promo.code %} - {{ promo.code }}{% endif %}{% if promo.percent is not null %} - {{ (promo.percent * 100)|number_format(0, ',', ' ') }}%{% endif %} : -{{ promo.discountShippingTTC|price_format }} €
{% endif %}
{% endfor %}
{{ 'checkout_design.total_ttc'|trans({}, null, locale|default('fr')) }} : {% if pricing %}{{ pricing.totalTTC|price_format }} €{% else %}-{% endif %}
{% if cart.urlDeSuiviCarrier %}

{{ 'delivery.mail.tracking_intro'|trans({}, null, locale|default('fr')) }}
{{ cart.urlDeSuiviCarrier }}
{% endif %}

{{ 'delivery.mail.footer'|trans({'%company%': company }, null, locale|default('fr')) }}
