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

<table class="table" id="sylius-product-variants" {{ sylius_test_html_attribute('product-variants') }}>
    <thead>
        <tr>
            <th>{{ 'sylius.ui.variant'|trans }}</th>
            <th>{{ 'sylius.ui.price'|trans }}</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
    {% for key, variant in product.variants %}
        <tr>
            <td>
                {{ variant.name }}
                {% if product.hasOptions() %}
                    {% for optionValue in variant.optionValues %}
                        <em>{{ optionValue.value }}</em>
                    {% endfor %}
                {% endif %}
            </td>
            <td class="sylius-product-variant-price price">
                <span class="price">
                    {{ money.calculatePrice(variant) }}
                </span>
            </td>
            <td>
                {{ form_widget(form.cartItem.variant[key], {'label': false}) }}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
