We spent hours and hours searching for solution and countless emails with
Shopify support. But finally the solution was in one checkbox
Please
check if in Locations the following checkbox is enabled
[image: image.png]
Issue: variant.inventory_quantity in Liquid always returned 0 for all variants on product pages (e.g., IDs mapped to 0), despite actual stocks like 8, 10, and -16. Code populated a JavaScript newData object from Liquid output.
Resolution: The root cause was a Shopify Locations setting. Enabling “Fulfill online orders from this location” fixed the zero values.
Additional clarification: inventory_quantity is not included when the variant object is serialized with the Liquid json filter. If using | json, that field will be missing/ignored; access it directly in Liquid or pass it explicitly before converting to JSON.
Status: Resolved by enabling the Locations checkbox; with a note to avoid relying on the json filter for inventory_quantity.
We spent hours and hours searching for solution and countless emails with
Shopify support. But finally the solution was in one checkbox
Please
check if in Locations the following checkbox is enabled
[image: image.png]