Custom Order Confirmation Notification

Highlighted
Tourist
5 0 0

Hello, I'd like to pop in some custom text when somebody orders a specific SKU. I think the code would be something like below. However when I test this, the text appears on all order notifications. Is there a "closing" or ending bit of code I need to include if the order does not include that specific SKU?

 

{% if line.variant.sku == EKIT201403 %}
Thank you for your support of our fundraiser! 100% of the proceeds will go to World Central Kitchen. Please click <a href="https://cdn.shopify.com/s/files/1/0300/1545/files/KitchenScience_eKit_APR2020_FNL.pdf?v=1587085000"><b>this link</b></a> to access and download our Kitchen Science E-Kit!
{% endif %}

0 Likes
Highlighted
Shopify Partner
1777 211 370

Try enclosing EKIT201403 in single quotes so it reads:

{% if line.variant.sku == 'EKIT201403' %}
Thank you for your support of our fundraiser! 100% of the proceeds will go to World Central Kitchen. Please click <a href="https://cdn.shopify.com/s/files/1/0300/1545/files/KitchenScience_eKit_APR2020_FNL.pdf?v=1587085000"><b>this link</b></a> to access and download our Kitchen Science E-Kit!
{% endif %}
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Tourist
5 0 0

Thanks for the suggestion! Looks like those should be in there. Added and for some reason it's still not working?


@Visely-Team wrote:

Try enclosing EKIT201403 in single quotes so it reads:

{% if line.variant.sku == 'EKIT201403' %}
Thank you for your support of our fundraiser! 100% of the proceeds will go to World Central Kitchen. Please click <a href="https://cdn.shopify.com/s/files/1/0300/1545/files/KitchenScience_eKit_APR2020_FNL.pdf?v=1587085000"><b>this link</b></a> to access and download our Kitchen Science E-Kit!
{% endif %}

 

0 Likes
Highlighted
Shopify Partner
1777 211 370

Not working as, you still get the message even if you order a product variant that has a sku different than the one you are comparing to?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Tourist
5 0 0

ordering the selected product (EKIT201403) the custom text isn't showing.

0 Likes
Highlighted
Shopify Partner
1777 211 370

can you share the entire code for the template you are using?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Tourist
5 0 0

<a href="https://www.raddishkids.com/?utm_source=email&utm_medium=email&utm_campaign=shopify_orderconfirmatio... src="https://i.imgur.com/MT5T3je.png"></a>
{% if line.variant.sku == 'EKIT201403' %}
Thank you for your support of our fundraiser!<p>100% of the proceeds will go to World Central Kitchen. Please click <a href="https://cdn.shopify.com/s/files/1/0300/1545/files/KitchenScience_eKit_APR2020_FNL.pdf?v=1587085000">... link</b></a>to access and download our Kitchen Science E-Kit!</p>
{% endif %}
<p>Thank you for placing your order with {{ shop_name }}! This email is to confirm your recent order.</p>
<p>Date {{ date | date: "%m/%d/%Y" }}</p>
<ul style="list-style-type:none"> {% for line in line_items %} <li> <img src="{{ line | img_url: 'small' }}" /> {{ line.quantity }}x {{ line.title }} for {{ line.price | money }} each </li> {% endfor %}
</ul>
{% if discounts %}
<p>Discounts: {{ discounts_savings | money_with_currency }}</p> {% endif %}
<p>Subtotal: {{ subtotal_price | money_with_currency }}</p>
{% for tax_line in tax_lines %} <p>{{ tax_line.title }} : {{ tax_line.price | money_with_currency }} </p>
{% endfor %} {% if requires_shipping %}
<p>Shipping: {{ shipping_price | money_with_currency }}</p>
{% endif %} <p>Total: {{ total_price | money_with_currency }}</p>
<p><b>Orders from Our Shop:</b> At this time, most items will ship separately. Your order is subject to delays and may take up to 1 week to ship due to coronavirus-related business restrictions. Thank you for your patience!</p>
<p><b>Join our Facebook Group:</b> <a href="https://www.facebook.com/groups/raddishfoodandfamily/">The Raddish Table: Food + Family</a> for fun tips, giveaways, and bonus content.

 

Screen Shot 2020-04-17 at 1.24.06 PM.png

0 Likes
Highlighted
Shopify Partner
1777 211 370

where does the line  variable in line.variant.sku comes from? There is no such variable in the template. There is line_items which you should use within a for loop (you have an example below) and check line.variant.sku equality to sku and display the message.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Tourist
5 0 0

Thanks so much for your suggestion. It's still not working, but let me know if your firm would be interested in doing this job.


@Visely-Team wrote:

where does the line  variable in line.variant.sku comes from? There is no such variable in the template. There is line_items which you should use within a for loop (you have an example below) and check line.variant.sku equality to sku and display the message.


 

0 Likes
Highlighted
Shopify Partner
1777 211 370

please share the entire code of your order notification template, we'll review it

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes