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

<table class="ui single line small 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() %}
                    <div class="ui horizontal divided list">
                        {% for optionValue in variant.optionValues %}
                            <div class="item">
                                {{ optionValue.value }}
                            </div>
                        {% endfor %}
                    </div>
                {% endif %}
            </td>
            <td class="sylius-product-variant-price">{{ money.calculatePrice(variant) }}</td>
            <td class="right aligned">
                {{ form_widget(form.cartItem.variant[key], {'label': false}) }}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
