{% set product = variant.product %}

<div class="media">
    <div class="cart-item-img-wrapper">
        <a href="{{ path('sylius_shop_product_show', {'slug': product.slug }) }}">
            {% if variant.hasImages %}
                {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': variant, 'filter': 'sylius_shop_product_tiny_thumbnail'} %}
            {% else %}
                {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'filter': 'sylius_shop_product_tiny_thumbnail'} %}
            {% endif %}
        </a>
    </div>

    <div class="media-body">
        <p class="cart-item-product-name" {{ sylius_test_html_attribute('product-name', item.productName) }}>
            <a class="link-secondary text-decoration-none" href="{{ path('sylius_shop_product_show', {'slug': product.slug }) }}">
                {{ item.productName }}
            </a>
        </p>
        <p class="cart-item-product-variant-code" {{ sylius_test_html_attribute('product-variant-code') }}>
            <a class="link-secondary text-decoration-none" href="{{ path('sylius_shop_product_show', {'slug': product.slug }) }}">
                {{ variant.code }}
            </a>
        </p>

        {% if product.hasOptions() %}
            <div class="cart-item-product-options" {{ sylius_test_html_attribute('product-options') }}>
                {% for optionValue in variant.optionValues %}
                    <em data-sylius-option-name="{{ optionValue.name }}" {{ sylius_test_html_attribute('option-name', optionValue.name) }}>
                        {{ optionValue.value }}
                    </em>
                {% endfor %}
            </div>
        {% elseif item.variantName is not null %}
            <span class="cart-item-product-variant-name" {{ sylius_test_html_attribute('product-variant-name') }}>
        {{ item.variantName }}
    </span>
        {% endif %}
    </div>
</div>
