Hello,
I need some help displaying the correct inventory quantity for variants. The quantity shown is always the quantity of the variant with the most in stock. I need it to show the quantity of the selected variant.
In the example above, it should say “We have 0 in stock”
Any help would be appreciated
Hi @davidre ,
Thanks for reaching out!
We understand the issue — it looks like the inventory quantity being displayed is always that of the variant with the highest stock, rather than the currently selected variant.
To resolve this, we’ll first need to review how your current setup is fetching the inventory data. If it’s possible to tweak it to pull the stock level of the selected variant instead, we can make that change directly.
If not, we can help set up a custom or private Shopify app that makes GraphQL calls to fetch the correct variant inventory dynamically and update the display accordingly.
We’d love to help you get this sorted! Let us know how you’d like to proceed, and we can take it from there.
Best,
Shubham | Untechnickle
Hi @davidre
This issue typically occurs when the product page fails to dynamically update the inventory based on the selected variant. To resolve this, ensure that the product template includes the appropriate JavaScript to display the correct stock quantity for the chosen variant.
Need to Update JavaScript to dynamically reflect the selected variant’s inventory and Modify Variant Options to include inventory data, ensuring accurate stock display.
Let me know if you need detailed assistance.