My variant.inventory_quantity is undefined

MoniAli
New Member
2 0 1

Hi,

 

I'm using the Brooklyn theme and attempting to allow customers to continue purchasing items that are out of stock, but displaying a message on the variant page that says "This product is on backorder, please expect delayed shipping". 

I've added some console logging to my theme.js and it seems that my variant object has no attribute named inventory_quantity, and when I try to console.log(variant.inventory_quantity) it comes up as undefined. 

I was wondering why this might be, and where the inventory would be tracked then so that I could conditionally display a message?

Willing to hire a developer if needed, thanks!

My site: https://www.eastlinq.com (password is eastlinq)

Replies 12 (12)
DongThanh
New Member
3 0 1

AlecuMarian Thanks for help!, It worked

mfaiz1993
New Member
1 0 0

Use current_variant.inventory_quantity instead of variant.inventory_quantity in theme.js file

Taz_Khan
Shopify Partner
13 0 2

Thanks

Taz Khan , Shopify Partner, Contact me here: https://www.facebook.com/maahirsystems/
http://pph.me/maahir-systems