This article explains how the bill of materials feature calculates the Available Stock, the Availability and the Maximum Purchase Quantity of a bill of materials in the storefront.
The logic primarily depends on the Closeout sale setting on the bill of materials itself as well as on the assigned (sub-)products.
Basics of the calculation
Term | Meaning | Standard calculation basis |
Available Stock | The maximum quantity orderable in the shop. | The minimum of the available stock of all stock-managed sub-products, divided by the required quantity. |
Availability | Indicates whether the product is purchasable. | Either Available Stock > 0 or Always available. |
Maximum Purchase Quantity | The maximum quantity allowed in the cart. | The lowest value from Available Stock, Maximum purchase quantity in the product and Maximum purchase quantity global. |
Closeout sale | The setting determining whether the product may be sold down to zero stock. |
Important: Bills of materials are always marked as not stock-managed in the system. However, the shop's availability logic is controlled by the availability of the products contained within it.
Bill of materials has Closeout sale ON
If Closeout sale is enabled on the bill of materials, availability is derived directly from the stock of the assigned products.
Assigned products | Available Stock | Availability | Maximum Purchase Quantity |
All not stock-managed |
| Available Stock > 0 | MIN(Available Stock; Maximum purchase quantity in the product; Maximum purchase quantity global). Additional cart validation. |
Only some not stock-managed | MIN (Available Stock / quantity of the stock-managed sub-products) | Available Stock > 0 | MIN(Available Stock; Maximum purchase quantity in the product; Maximum purchase quantity global). Additional cart validation. |
All stock-managed | MIN (Available Stock / quantity of the assigned products) | Available Stock > 0 | MIN(Available Stock; Maximum purchase quantity in the product; Maximum purchase quantity global). Additional cart validation. |
All have Closeout sale ON | Calculation follows the standard behavior. | Available Stock > 0 | MIN(Available Stock; Maximum purchase quantity in the product; Maximum purchase quantity global). Additional cart validation. |
Bill of materials has Closeout sale OFF
If Closeout sale is disabled on the bill of materials, the bill of materials is displayed as always available in the frontend, regardless of the current available stock of the sub-products.
Assigned products | Available Stock | Availability | Maximum Purchase Quantity |
All not stock-managed |
| Always available | MIN(Maximum purchase quantity in the product; Maximum purchase quantity global). |
Only some not stock-managed | MIN (Available Stock / quantity of the stock-managed sub-products) | Always available | Maximum purchase quantity in the product or maximum purchase quantity global. |
All stock-managed | MIN (Available Stock / quantity of the assigned products) | Always available | Maximum purchase quantity in the product or maximum purchase quantity global. |
All have Closeout sale ON | See scenario 1, row 4. The closeout sale setting of the bill of materials becomes irrelevant. | Available Stock > 0 | MIN(Available Stock; Maximum purchase quantity in the product; Maximum purchase quantity global). Additional cart validation. |
Notes on cart validation
In all cases where Closeout sale is enabled for the bill of materials or the assigned products, the system performs an additional validation in the cart.
This ensures that the available stock of the assigned products with closeout sale enabled is sufficient even when the same sub-product is contained multiple times across different bills of materials or as an individual item in the cart.
