"available" field in liquid product variant does not work when inventory at app location

I maintain an app that adds products to our users’ Shopify product catalog, and it maintains inventory. Occasionally, the products will show as Out of Stock on a store’s product page, even if the admin shows the product having stock at the app’s inventory location.

I checked the theme code for a store where this issue exists, and the “available” field on the variant liquid object returns false. If I add stock to the variant at the store location, it does return true.

When I query the variant with graphQL, I see the following: {“activatable”:true,“fulfillsOnlineOrders”:true,“isFulfillmentService”:true,“hasActiveInventory”:true,“isActive”:true,“shipsInventory”:false}}

Any suggestions? Another odd note is that I do not have access to some of the attributes listed in the Liquid documentation. For example, I can’t see variant.inventory_quantity or variant. inventory_policy

Thanks!

I’m not sure about the app stuff, but variant.inventory_quantity and variant.inventory_policy is hidden from .json and public endpoints.

It’s available via liquid, but now the public json. It’s made like that to prevent bots and competitors campaigning based off your inventory.

1 Like

Thanks. I tested inventory_quantity and inventory_oolicy, and they show in liquid.

I may have to use javascript via the storefront API to get this to work.

1 Like