Get inventory quantity on new order email template

Hello,

When a new order is made, the administrators receives an email with the order details. It’s ok.

I’d like to edit this notification template to display the information if the products are in inventory or if I would have to manufacture them (or some).

Reading the guide for Notification Variable Template (https://help.shopify.com/en/manual/orders/notifications/email-variables)) it seems there’s no variable available that could bring me that information. Is it right? Or am I missing something?

Would be there any workaround?

Thanks

2 Likes

I wonder, if it is not possible, then would it be possible to have the inventory qty information on the orders page inside admin area? I mean, after clicking on a specific order.

The admin area allow this kind of customization?

We are looking the same, it will be great if the new order email can show the available quantity too. Do you have any luck in finding a solution?

Sorry dude, we simply gave up due to this lack of support. :disappointed_face:

Did you figure out a way to do this?

i have a similar desire of showing a line item value in order confirmation emails based on inventory state at a location. The only way I’ve come up with is to use Shopify flow and an inventory-change trigger to update the value of a variant metafield containing an integer of current stock value at a location. Was wondering if you came up with a way using less moving parts.

Sorry,

I could not accomplish that so we changed the project specs.

We are looking the same, I can now see there is a variable called line.current_quantity which I thought would show the inventory quantity, but it doesn’t.

https://help.shopify.com/en/manual/orders/notifications/email-variables

Would anyone share the workaround or solution if you find it? Thanks so much.

Ha, @jaircuevajr @amanda-91 I finally found a way to do this. Use this variable {{ line.variant.inventory_quantity }} to get the inventory stock, and then substract the {{line.quantity}}. So this should get what you need {{ line.variant.inventory_quantity - line.quantity }}

2 Likes

Hi

Can you help me how the code should look?

Thanks. It helped me to see the Available and On-hand quantity in email itself.

1 Like

Well done @oeshop !
Appreciate your effort.

I couldn’t test it yet, but it looks right.

I never got the code to work as it should, i give the wrong stock-amount.