Learn / Fixes
How to expose stock availability to agents
Availability is only useful to an agent when it is stated per variant and when it is accurate in the negative. Stores routinely publish availability that is correct while a product is in stock and silently wrong once it is not, or that describes a product rather than the size a shopper asked for, and neither error is visible to anyone testing with a product that happens to be available.
Availability is only useful when it is stated per variant and accurate in the negative. Most stores get it right in the one case nobody needs it to be right: a product that is in stock, checked by a person who can see it is in stock.
This is the fix for missing availability.
Availability is a property of the variant
A shopper asks for a jacket in a specific size. If your data says the jacket is available, you have answered a question nobody asked. The agent either proceeds and fails at the variant picker, or treats your answer as unreliable and moves on.
Every size and colour needs its own availability, alongside its own price and identifier. See how to make variant pickers agent accessible for the interface half of the same problem.
Being right when the answer is no
Test with a product that is out of stock. This is the test almost nobody runs, and it is where the defect lives, because an availability field populated from a truthy check is correct exactly while the answer is yes.
The cost of getting this wrong is larger than it looks. An agent does not treat a failed purchase as a reason to try another product from you. It treats it as a reason to try another store.
Say which source is authoritative
Most stores publish availability in at least two places: the product page and the feed. They will disagree, because they refresh on different schedules. Decide which one is authoritative and make the other match rather than leaving an agent to arbitrate.
If your stock moves faster than your feed refreshes, your feed is a snapshot being presented as a fact. See how to keep a product feed fresh.
The states that are not in stock
Backorder, preorder, discontinued and available to order are all different from in stock, and collapsing them into it converts an honest answer into a failed purchase. State them as what they are. An agent that knows an item ships in four weeks can decide; an agent that finds out at checkout has already wasted the attempt.
Questions
Why does out of stock accuracy matter when I would rather hide it?
Because an agent that is told something is available and then cannot buy it does not try a different size, it stops. You have spent your one attempt on a product you could not sell, and the shopper is offered a competitor instead.
My stock changes constantly. How current does this need to be?
Current enough that the answer is right when it is checked. If your feed refreshes daily and your stock moves hourly, the feed is a snapshot presented as a fact. Either refresh faster or make the product page authoritative and say so.
What about backorders and preorders?
State them explicitly rather than treating them as in stock. An agent buying for somebody who needs an item this week treats a four week backorder as a failure, and discovering it at checkout wastes the attempt.