TOTALES
{% set totalproducts = 0 %} {% for p in products %} {% set subtotal = (p.unit_price_with_taxes * p.quantity) %} {% set totalproducts = totalproducts + subtotal %} {% endfor %}
{{ totalproducts | number_format(2, '.', ',') }}
{{ order.shipping_subtotal | number_format(2, '.', ',') }}
{% set totalPrice = totalproducts + order.shipping_subtotal %}
$ {{ totalPrice | number_format(2,'.',',') }}
{% set totalDiscount = 0 %} {% if discounts is not empty %}
{% for d in discounts %} {% set totalDiscount = totalDiscount + d.unit_price_with_taxes %} {% endfor %} {{ totalDiscount | number_format(2, '.', ',') }}
{% endif %}
{% set finalPrice = totalPrice - (totalDiscount * (-1)) %} $ {{ finalPrice | number_format(2,'.',',') }}
{% if costo > 0 %}
{{ costo | number_format(2, '.', ',') }}
{% endif %}