Inventory_policy missing from product schema?


It seems like the product schema is missing the inventory_policy field? (

Inventory policy meaning the “Allow customers to purchase this product when it’s out of stock” input.

I noticed this when the default UI’s [[ # can_order ]] block gets false even with products that have the input checked. I tracked the functionality to this code in the algolia_instant_search.js.liquid:241

product.can_order = product.inventory_policy === 'continue' || product.inventory_quantity > 0;

product.inventory_policy returns undefined.

Is the schema missing the property or am I doing something wrong?

You are right. I did indeed forget to add it to our indexed attributes in Algolia when I added this in our front-end.
This is now fixed!
You’ll just need to run reindex for your products in the Indexing tab of our application to see those.

1 Like