When using Omnichannel Inventory (OCI):
- OCI supports backorders, but does not support preorders or perpetual availability. OCI refers to expected restocks as Future inventory.
- OCI uses an eventual consistency model with asynchronous inventory data updates. Your code must not assume that inventory-affecting actions, such as placing orders, will immediately change inventory levels.
- If inventory lists are in use:
- If no inventory record exists and the inventory list default-in-stock flag is true this method returns 1.
- If no inventory record exists the inventory list default-in-stock flag is false this method returns 0.
- If the product is not available this method returns 0.
- If the product is perpetually available this method returns 1.
- Otherwise, this method returns ATS / (allocation + preorderBackorderAllocation). (Values from ProductInventoryRecord.)
- For a master product this method returns the average availability of its online variations.
- For a master product with no online variations this method returns 0.
- For a master product with own inventory record the rules of the standard products apply. Note: In this case the availability of the variations is not considered.
- For a product set this method returns the greatest availability of the online products in the set.
- For a product set with no online products this method returns 0.
- For a product set with an inventory record the rules of the standard products apply. Note: In this case the availability of the set products is not considered.
- For a bundle, this method returns the least availability of the bundled products according to their bundled quantity and if it exist also from the bundle inventory record.
Note: Orderable status is more general than in-stock status. A product may be out-of-stock but orderable because it is back-orderable or pre-orderable.
- If the product is in stock this method returns the availability of the product.
- If the product is out of stock this method returns 0.
- For a master product this method returns the average SKU coverage of its online variations.
- For a master product with no online variations this method returns 0.
- For a product set this method returns the ratio of orderable SKUs in the product set over the total number of online SKUs in the product set.
- For a product set with no online products this method returns 0.
- For a product bundle this method returns 1 if all of the bundled products are online, and 0 otherwise.
- For a product bundle with no online bundled products this method returns 0.
- If the product is out of stock this method returns 0.
- If the product is perpetually available this method returns 1.
- If the sales velocity or ATS is not available this method returns 0.
- Otherwise this method returns ATS / sales velocity.
- For a master product this method returns the greatest time to out of stock of its online variations.
- For a master product with no online variations this method returns 0.
- For a product set this method returns the greatest time to out of stock of the online products in the set.
- For a product set with no online products this method returns 0.
- For a bundle with no product inventory record, this method returns the least time to out of stock of the online bundled products.
- For a bundle with no product inventory record, and no online bundled products, this method returns 0.
Returns an instance of ProductAvailabilityLevels, where each available quantity represents a part of the input quantity.
- If inventory lists are in use:
- If no inventory record exists and the inventory list default-in-stock flag is true this method returns 1.
- If no inventory record exists the inventory list default-in-stock flag is false this method returns 0.
- If the product is not available this method returns 0.
- If the product is perpetually available this method returns 1.
- Otherwise, this method returns ATS / (allocation + preorderBackorderAllocation). (Values from ProductInventoryRecord.)
- For a master product this method returns the average availability of its online variations.
- For a master product with no online variations this method returns 0.
- For a master product with own inventory record the rules of the standard products apply. Note: In this case the availability of the variations is not considered.
- For a product set this method returns the greatest availability of the online products in the set.
- For a product set with no online products this method returns 0.
- For a product set with an inventory record the rules of the standard products apply. Note: In this case the availability of the set products is not considered.
- For a bundle, this method returns the least availability of the bundled products according to their bundled quantity and if it exist also from the bundle inventory record.
Returns an instance of ProductAvailabilityLevels, where each available quantity represents a part of the input quantity. This method is typically used to display availability information in the context of a known order quantity, e.g. a shopping cart.
For example, if for a given product there are 3 pieces in stock with no pre/backorder handling specified, and the order quantity is 10, then the return instance would have the following state:
- ProductAvailabilityLevels.getInStock() - 3
- ProductAvailabilityLevels.getPreorder() - 0
- ProductAvailabilityLevels.getBackorder() - 0
- ProductAvailabilityLevels.getNotAvailable() - 7
- Between 1 and 3 levels are non-zero.
- The sum of the levels equals the input quantity.
- ProductAvailabilityLevels.getPreorder() or ProductAvailabilityLevels.getBackorder() may be available, but not both.
Product bundles are handled specially: The availability of product bundles is calculated based on the availability of the bundled products. Therefore, if a bundle contains products that are not in stock, then the bundle itself is not in stock. If all the products in the bundle are on backorder, then the bundle itself is backordered. If a product bundle has its own inventory record, then this record may further limit the availability. If a bundle has no record, then only the records of the bundled products are considered.
Product masters and product sets without an own inventory record are handled specially too: The availability is calculated based on the availability of the variants or set products. A product master or product set is in stock as soon as one of its variants or set products is in stock. Each product master or product set availability level reflects the sum of the variant or set product availability levels up to the specified quantity.
Product masters or product sets with own inventory record are handled like standard products. The availability of the variants or set products is not considered. (Such an inventory scenario should be avoided.)
Offline products are always unavailable and will result in returned levels that are all unavailable.
When using Omnichannel Inventory (OCI), future restocks provided by OCI are mapped to AVAILABILITY_STATUS_BACKORDER. For more information, see the comments for ProductInventoryRecord.- If the product is in stock this method returns the availability of the product.
- If the product is out of stock this method returns 0.
- For a master product this method returns the average SKU coverage of its online variations.
- For a master product with no online variations this method returns 0.
- For a product set this method returns the ratio of orderable SKUs in the product set over the total number of online SKUs in the product set.
- For a product set with no online products this method returns 0.
- For a product bundle this method returns 1 if all of the bundled products are online, and 0 otherwise.
- For a product bundle with no online bundled products this method returns 0.
- If the product is out of stock this method returns 0.
- If the product is perpetually available this method returns 1.
- If the sales velocity or ATS is not available this method returns 0.
- Otherwise this method returns ATS / sales velocity.
- For a master product this method returns the greatest time to out of stock of its online variations.
- For a master product with no online variations this method returns 0.
- For a product set this method returns the greatest time to out of stock of the online products in the set.
- For a product set with no online products this method returns 0.
- For a bundle with no product inventory record, this method returns the least time to out of stock of the online bundled products.
- For a bundle with no product inventory record, and no online bundled products, this method returns 0.
- If the product is not currently online (based on its online flag and online dates), then return false.
- If there is no inventory-list for the current site, then return false.
- If there is no inventory-record for the product, then return the default setting on the inventory-list.
- If there is no allocation-amount on the inventory-record, then return the value of the perpetual-flag.
- If there is an allocation-amount, but the perpetual-flag is true, then return true.
- If the quantity is less than or equal to the stock-level, then return true.
- Otherwise return false.
Note: Orderable status is more general than in-stock status. A product may be out-of-stock but orderable because it is back-orderable or pre-orderable.
Note: Orderable status is more general than in-stock status. A product may be out-of-stock but orderable because it is back-orderable or pre-orderable.