Hello Shopify community,
I’m using a custom variants app for my Shopify store, and while it’s a great app it does have the drawback of splitting customer orders into two products: the product itself and the variants (listed as “[product name] - Details”. I’d like to remove the second product title in my order confirmation emails, as it’s creating a lot of confusion for my customers.
I’d like to insert some html code that removes the product title if the variant title contains ‘Details.’ Can you advise on what this code looks like and where to insert it. Current code and a screenshot to further illustrate my goal below.
I’ve spent several hours trying to insert something like {if line_item.title contains ‘Details’ %} {assign product.title = ’ ’ %}, but nothing has worked. Really hope you can provide a solution here. Thank you!
Current code
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{{ line_title }}
{% if line.variant.title != 'Default Title' %}
{% assign variantOptions = line.variant.title | split: ' / ' %}
{% for option in variantOptions %}
{{ option }}
Here’s an illustration of what I’m looking to do:
