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

{% set unitPromotionAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT') %}
{% set unitPromotions = item.units.first.adjustments(unitPromotionAdjustment) %}
<tr {{ sylius_test_html_attribute('product-row', item.productName) }}>
    <td>
        {% include '@SyliusShop/Product/_info.html.twig' with {'variant': item.variant} %}
    </td>

    <td class="text-right">
        <span class="title-mobile">{{ 'sylius.ui.unit_price'|trans }}</span>
        {% if item.unitPrice != item.discountedUnitPrice %}
            <span class="product-price-old" {{ sylius_test_html_attribute('product-old-price', item.productName) }}>{{ money.convertAndFormat(item.unitPrice) }}</span>
        {% endif %}
        <span class="product-price" {{ sylius_test_html_attribute('product-unit-price', item.productName) }}>{{ money.convertAndFormat(item.discountedUnitPrice) }}
            {% if item.unitPrice != item.discountedUnitPrice %}
            <i id="item-promotion-details" class="question circle icon unit-promotions popup-js"
               data-html="{% for promotion in unitPromotions %}<div>{{ promotion.label }}: {{ money.convertAndFormat(promotion.amount) }}</div>{% endfor %}">
            </i>
            {% endif %}
        </span>
    </td>

    <td class="text-md-center">
        <span class="title-mobile">{{ 'sylius.ui.qty'|trans }}</span>
        {{ item.quantity }}
    </td>
    <td class="text-right">
        <span class="title-mobile">{{ 'sylius.ui.total'|trans }}</span>
        <span class="product-price">{{ money.convertAndFormat(item.subtotal) }}</span>
    </td>
</tr>
