Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
We have some custom code to display the inventory status of each product on the product page and on the collection page (in stock, available for back-order, out of stock, etc.). This works nicely, except for products that are bundled with the Shopify Bundles app. On these bundles, the inventory_quantity is for some reason always 0, causing them to show as if their not in stock.
The current way we check this is with product.selected_or_first_available_variant.inventory_quantity. Is there a different way to check the inventory of a bundled product or the products inside the bundled product? I cannot find anything about this.
Ok so this gets really weird: when viewing our site in the Shopify Editor, everything work perfect. The quantity of the bundel is the quantity of the product with the lowest quantity, which is the correct behavior. But when viewing the live version of the site, all the quantities are 0.
When console logging product.selected_or_first_available_variant.inventory_quantity it shows the correct value's in the editor:
But on the live website, they are all zero:
Could anyone explain to me what causes this and how to fix this? Would be much appreciated!
Anyone?
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