cfry
July 27, 2022, 11:18pm
1
I’m trying to add a certain line of text to the order confirmation email if a certain product has been ordered.
I’ve tried to do this:
{% if line_item.product.title contains ‘product title’ %}
Display this message
{% endif %}
I can’t get it to work. What am I doing wrong? Any help would be so appreciated.
Hi @cfry ,
Please go to Theme settings > Notifications > Order Confirmation. Find ‘subtotal_line_items’ and add code here:
Code:
{% if line_title contains 'product title' %}
Display this message
{% endif %}
Hope it helps!
1 Like
cfry
July 28, 2022, 7:49pm
3
Thank you! Worked like a charm
cfry
July 28, 2022, 11:05pm
4
Do you know if there is a way to be able to use this logic so it calls a paragraph above the “order details” depending on the product that was sold? Thank you so much for your help.
Hi @cfry ,
Are you referring to the customer order page?
You can add the same code at customers/order.liquid file.
Hope it helps!
1 Like
cfry
July 29, 2022, 4:29pm
6
First off - Thank you for your help!
I’m trying to still add content to the body of the order confirmation email. I’ve added the content to the order details area.
I would like to add something at the beginning of the body of the email before the order details show.
Example:
Thank you for your order. Your order will be processed within 1-2 business days. You’ll receive a tracking number once it’s been shipped.
Then I want to create an if statement if they purchased a certain product and show it if it’s in the order like we did before.
Example:
Thank you for your order. Your order will be processed within 1-2 business days. You’ll receive a tracking number once it’s been shipped.
{% if line_title contains ‘product title’ %}
Please allow 2-3 business days for this product to be shipped.
{% endif %}
I just can’t seem to get what we did earlier to work in the body part above order details.
Hi @cfry ,
Please add code:
{% for line in subtotal_line_items %}
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% if line_title contains 'product title' %}
Display this message
{% break %}
{% endif %}
{% endif %}
{% endfor %}
Hope it helps!
2 Likes
cfry
July 30, 2022, 2:21pm
8
Thank you! Thank you! Thank you!
1 Like
Hi! I have the exact same issue and I have been using this code succesfully with my previous products and all the sudden it does not work for my new product.. any idea what could be the issue?
Hey, Can we display different images based on the products chosen?
Thank you