Hi Everyone,
In my order confirmation emails, I am trying to add a line of code to hide the default message if the customer has purchased a specific product and nothing else in the order.
So far if the customer purchases they receive the default message below:
Hey{% if billing_address.first_name.size <= 1 %},{% else %}
{{ billing_address.first_name }},
{% endif %}
Thanks for shopping. We’ll email you as soon as your order has shipped.
Next, if the item in question (referred to as test) is purchased the following code is used and displays a message underneath the default message for further instructions.
{% assign count = 0 %}
{% for line in subtotal_line_items %}
{% if line.product.tags contains “test” and count < 1 %}
{% assign count = count | plus: 1 %}
Great call getting a test product. We just wanted to let you know that it’s on the way over to your inbox. Thanks for shopping!
{% else count == 1 %}
{% break %}
{% endif %}
{% endfor %}
My goal is to hide the default message if the customer only purchases the ‘test’ product. Is this possible to achieve?
Thanks for your time ![]()