Hide Content in Order Confirmation Email

Noah2021
New Member
5 0 0

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 %}<br><br>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

0 Likes
KetanKumar
Shopify Partner
15984 1759 5900

@Noah2021 

Thanks for post 

which content do you have to hide this email template?

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
Noah2021
New Member
5 0 0

@KetanKumar 

 

I would like to hide the following part of my email If the customer has purchased only the "test" product and no other items.

Hey{% if billing_address.first_name.size <= 1 %},{% else %}
{{ billing_address.first_name }},
{% endif %}<br><br>Thanks for shopping. We’ll email you as soon as your order has shipped.

 

Does that make sense?

0 Likes
Noah2021
New Member
5 0 0

Is what I would like to accomplish possible?

0 Likes
Noah2021
New Member
5 0 0

I am guessing you cannot hide content using liquid if the customer only purchases a specific item by itself?

0 Likes
KetanKumar
Shopify Partner
15984 1759 5900

@Noah2021 

can you please just comment if you have to hide any content like this  

{% comment %}
if you have hide any content type here...
{% commentend %}

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
Noah2021
New Member
5 0 0

Hi @KetanKumar 

 

Thanks for the response but that is not what I am trying to do.

 

I need to not display a message ONLY IF the customer has purchased a specific product by itself.

0 Likes
KetanKumar
Shopify Partner
15984 1759 5900

@Noah2021 

thanks for it

it can be done some customization please sent personal messaage 

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes