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

Solved

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

peter_vw
New Member
8 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 358

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 5 (5)

AliReviews
Shopify Partner
773 90 358

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
8 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?

megbraffdesigns
Visitor
1 0 0

I would like to do the same thing but instead of the stock being 0, any time someone places an order that's above my current stock I'd like it to send out a backorder email. So if I have 5 units and the order is for 10, I'd like an email acknowledging the backorder lead time. How can I do that?

peter_vw
New Member
8 0 0

Hi Megbraffdesigns,

I changed my code to the equal-to-or-less "<=" as opposed to equal to 0 "==0", and that seems to be doing the trick of if a customer orders over what I've got available they will get the backorder email. 

{% for line_item_product in line_items %}
  {% if line_item_product.variant.inventory_quantity <= line_item_product.quantity %}
    <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 %}