We have the order confirmation HTML taken from Klayvio.
I have mutule products where only on those specific products I need to add an additional line of text as they are made to measure products.
I want to simply create something like
{% if line_title contains ‘Item 1 or Item 2 or Item 3’ %}
You have purchased an item that is custom made. We want to make sure you have everything right so we’ll be contacting you shortly.
{% endif %}
Ready-to-paste snippet you can drop inside your order confirmation email template. It loops through each product in the order and adds your custom message if the product matches your condition:
{% for line in line_items %}
<p>
{{ line.title }}
</p>
{% if line.title contains 'Item 1'
or line.title contains 'Item 2'
or line.title contains 'Item 3' %}
<p style="color:#d9534f; font-weight:bold;">
You have purchased an item that is custom made. We want to make sure you have everything right, so we’ll be contacting you shortly.
</p>
{% endif %}
{% endfor %}
This will:
Print each product name (line.title)
Show your custom message only for the items that match “Item 1”, “Item 2”, or “Item 3”.
Style the message a little (red and bold) so it stands out in the email — you can remove the style="" part if you want plain text.
If you’d rather manage it by tagging products instead of hardcoding names (recommended, especially as your catalog grows), here’s the version using tags:
{% for line in line_items %}
<p>
{{ line.title }}
</p>
{% if 'custom-made' in line.product.tags %}
<p style="color:#d9534f; font-weight:bold;">
You have purchased an item that is custom made. We want to make sure you have everything right, so we’ll be contacting you shortly.
</p>
{% endif %}
{% endfor %}
Then, just add the tag custom-made to any product in Shopify that needs this note.