I want to display the variant title only on line items which have more than one variant.
On the Image you can see the bold Product title and undeneath there is the variant title (Format A2). As you can see the last line item has only one variant so it's unnecessary to show the title there twice.
How do I write the conditional to show the title only on products with more than one variant?
On the Product page I just wrote it like this:
{% if product.variants | length > '1' %}
{% for purchasable in product.variants %}
{{ purchasable.title }}
{% endfor %}
{% endif %}
But in the cart it's a line item and not a product so this code doesn't work. How do I have to apply this to a line item?