How can I correctly edit an email template for different product variants?

Samik1
Visitor
3 0 1

{% if line.variant.title == 'ProductName/VaraintName' %}
You are buying some awesome shoes!
{% endif %}

 

What am I doing wrong here. I am trying to input this in the email template and depending on which Variant they order I want to display such comments 

Reply 1 (1)

made4Uo
Shopify Partner
3821 716 1153

Hi @Samik1 , 

 

I am assuming this is for the order confirmation email. You have the right code. Make sure you have the exact product title though. You can try pasting the code below to check the line.variant.title and make dummy product with zero cost. Buy that product and check your email.

 

          {% if line.variant.title != blank %}
            <span class="order-list__item-variant">The variant title is: {{ line.variant.title }}</span><br/>
          {% endif %}

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free