Solved

Modify "Order confirmation" email to alert customers of items on backorder

peter_vw
New Member
6 0 0

Hello,

 

On my store I have "Continue selling when out of stock" enabled, and what I would like to do is when a customer places an order for an item that I have on backorder is to have a custom message in the automatic "Order confirmation" email letting them know that parts of their order will be delayed.

 

But I would like this to only trigger if an item purchased matches the inventory quantity available/on hand = 0.

 

So if all items they have purchased I do actually have on hand then they won't receive that portion of text in the "Order confirmation" email.

 

Any help is appreciated,

Thank you.

Accepted Solution (1)

AliReviews
Shopify Partner
773 90 356

This is an accepted solution.

Hello @peter_vw ,

 

You can try to follow these steps:

  • Go to Settings -> Notifications -> Edit order confirmation email template
  • Modify the email template: In the email editor, locate the section where you want to add the custom message. Typically, this will be in the body of the email. You can add the following conditional liquid code to display the message only when a backordered item is present:
{% for line_item in line_items %}
  {% if line_item.variant.inventory_quantity == 0 %}
    <p>A portion of your order is on backorder. Please note that there may be a delay in shipping these items. We apologize for any inconvenience caused.</p>
    {% break %}
  {% endif %}
{% endfor %}
  • Save changes

 

Hope this can help you out. Let us know if you need any further support.

Ali Reviews team.

- Was my answer helpful? Please hit Like or Mark it as solution!
- Ali Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!

View solution in original post

Replies 3 (3)

AliReviews
Shopify Partner
773 90 356

This is an accepted solution.

Hello @peter_vw ,

 

You can try to follow these steps:

  • Go to Settings -> Notifications -> Edit order confirmation email template
  • Modify the email template: In the email editor, locate the section where you want to add the custom message. Typically, this will be in the body of the email. You can add the following conditional liquid code to display the message only when a backordered item is present:
{% for line_item in line_items %}
  {% if line_item.variant.inventory_quantity == 0 %}
    <p>A portion of your order is on backorder. Please note that there may be a delay in shipping these items. We apologize for any inconvenience caused.</p>
    {% break %}
  {% endif %}
{% endfor %}
  • Save changes

 

Hope this can help you out. Let us know if you need any further support.

Ali Reviews team.

- Was my answer helpful? Please hit Like or Mark it as solution!
- Ali Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!
peter_vw
New Member
6 0 0

Thanks for your reply, AliReviews, I appreciate the quick response.

 

That code works beautifully and is exactly what I want, so thank you for providing that. Is there any way to be able to pinpoint for the client exactly which item will be delayed? 

 

Cheers

wmitchell
New Member
4 0 0

@AliReviews this step is not working for me. I am using the Symmetry Theme. I would like the default line "Good news! We're getting your order ready!" to be replaced with "The item you ordered is currently on Backorder. It could take 10-15 days for your item to become available. If you would like to exchange your item for an in-stock product, please contact us at info@therowdyrose.com."

 

Currently I am using Shopify Flow to tag all products with inventory of "less than 1" as "Out of Stock".

 

I was thinking of using this in my email:

 

{% else %}
Good news! We're getting your order ready!

{% else %}
{% if line_item.variant.product.tags.each do |tag|}
if tag = "Out of Stock"
contains_tag=true
<p>A portion of your order is on backorder. Please note that there may be a delay in shipping these items. We apologize for any inconvenience caused.</p>
{% break %}
{% endif %}
{% endfor %}
{% endcase %}

 

But it is not working...

 

How could I do this?