I have a page that loops through a customers order history looking for products that will display when the conditions are met. Below is the code I am using.
item.title will display the product name and the variant name combined, but I only want the variant name.
Is there a way to use ONLY the variant name when running through an order history? I’ve not been able to find a way to identify that object.
{% if item.variant.metafields["global"]["Title-Name"] %}
{{ item.title }}
{{ item.variant.metafields["global"]["Title-Name"]}}
{% else %}
{{ item.product.title }}
{% endif %}