{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}

{% set orderPromotionAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT') %}
{% set orderPromotions = sylius_aggregate_adjustments(order.getAdjustmentsRecursively(orderPromotionAdjustment)) %}

{% if not orderPromotions is empty %}
    <td colspan="2" id="promotion-discounts" {{ sylius_test_html_attribute('promotion-discounts') }}>
        <div class="ui relaxed divided list">
            {% for label, amount in orderPromotions %}
                <div class="item">
                    <div class="content">
                        <div class="header">{{ label }}</div>
                        <div class="description">
                            {{ money.convertAndFormat(amount) }}
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    </td>
{% endif %}
<td colspan="{% if not orderPromotions is empty %}2{% else %}4{% endif %}" id="promotion-total" class="text-right" {{ sylius_test_html_attribute('promotion-total') }}>
    {{ 'sylius.ui.promotion_total'|trans }}:
    {{ money.format(order.orderPromotionTotal, order.currencyCode) }}
</td>
