Availability Calculation

Each product has a product record. A product doesn't appear in search results if it isn't orderable. For search availability ranking, the product is ranked high or low based on its available to sell (ATS) value. A product's availability is calculated from its inventory and the stock update mechanism.

Master Product and Variation Availability Calculation

  • A master product can't be ordered. Its availability status is the availability of its variants.
  • A master product can have an inventory record but this is not a best practice. Instead, assign inventory records to the variants, because customers can order them.
  • A master is orderable or inStock if at least one of the variants of the master is orderable or in-stock. Although a master product can never be ordered directly, if you have enabled the Show Orderable Products Only search preference (site or product level), whether a master product is considered orderable controls whether it shows up in the search results. Also, if you have sorting rules that sort by availability, whether a master product is orderable controls where it appears in the search results.
  • If the master contains a bundle, availability must be determined in a recursive manner.
  • The master doesn't appear in search results if none of the variants that the master represents in the current search result is orderable.
  • For search availability ranking, the master is ranked high or low based on the ATS of the variants it represents in the current search result. For example, if it represents at least one variant with good availability, it is ranked high.

Product Bundle Availability Calculation

  • Products in a bundle can have inventory records.
  • If one item in the product bundle is unavailable, the entire bundle is unavailable.
  • If a product bundle has an inventory record, Salesforce B2C Commerce uses the inventory record in the calculation of the availability of the product bundle.
  • A bundle can have its own inventory record. This enables you to control availability of bundles independently from the availability of the bundled products. You don't need a bundle inventory record if bundle availability is "perpetual".
    • If a bundle has its own inventory record and the Use Bundle Inventory Only option isn't selected, this record and the records of the bundled products determine availability. Therefore, both the bundle and the bundled products must be available.
    • If a bundle has its own inventory record and the Use Bundle Inventory Only option is selected in the inventory list, only the availability of the bundle is used to calculate availability. In this case, even if bundled products are not available, the bundle remains available. This is useful if the inventory of the bundle and the individual products is tracked separately in your backend ordering or inventory system.
    • If a bundle has no inventory record and the Use Bundle Inventory Only option isn't selected, only the records of bundled products are used to determine availability. For example, if a product bundle contains two products, one of which has 10 in stock, and the other of which has five in-stock and 10 on backorder, there are five bundles in stock and five on backorder. In this case, product bundles are unaffected by the default in-stock setting of the site inventory list.
    • If a bundle has no inventory record and the Use Bundle Inventory Only option is selected, the inventory list default in-stock option defines whether the bundle is available. If this option is set, the bundle is always available, otherwise is it never available.
      Note: Use getAvailabilityModel().isInStock(). The in-stock flag has been deprecated.
  • If a bundle contains other bundles or masters, availability is determined in a recursive manner.
  • A bundle doesn't appear in search results if it isn't orderable.
  • For search availability ranking, the bundle is ranked high or low based on the lowest ATS of all bundled products and the bundle itself (if bundle has a record).

Product Set Availability Calculation

  • A product set can't be ordered. Its availability status is the availability of the set products.
  • A product set can't have an inventory record. If it has one, the record isn't used.
  • A product set is 'orderable' or 'in-stock' if at least one of the set products is orderable or in-stock
  • If a product set contains bundles or masters, availability is determined in a recursive manner
  • A product set isn't shown in search results if none of the set products that the product set represents in the current search result is orderable.
  • For search availability ranking, the product set is ranked high or low based on the ATS of the set product it represents in the current search result. For example, if it represents at least one set product with good availability, it is ranked high.

Related Links

Inventory Management