Shopify themes, liquid, logos, and UX
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.
Solved! Go to the solution
This is an accepted solution.
Hello @peter_vw ,
You can try to follow these steps:
{% 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 %}
Hope this can help you out. Let us know if you need any further support.
Ali Reviews team.
This is an accepted solution.
Hello @peter_vw ,
You can try to follow these steps:
{% 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 %}
Hope this can help you out. Let us know if you need any further support.
Ali Reviews team.
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
@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?
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?
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 %}
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025