Summary
Products that are out of stock are available for purchase on the product page (the buy button appears). However, by clicking the button and going to the cart, Checkout queries the system and prevents the product from being actually purchased.
The cause of this is a field called stockBalance
, which is one of the fields used by the Catalog to display (or not) the buy button on the product page. This field displays the total units in stock for an SKU. However, when a product is associated with a gift, stockBalance
is returning the gift's stock instead of the SKU's stock. And that's exactly where the problem lies. The scenario will happen when a product has no stock but the gift associated with it does.
Simulation
- Add a gift to a product that is currently out of stock.
- Access its product page.
Workaround
For now, the solution is to disassociate the gift from the product with no stock. This will render the product unavailable again.