Product availability and purchase option
Before the release of catalog 16.0.3 the product availability was calculated "on the go" when retrieving from database. Subsequent to this, you cannot get product availability with SKUs. Now, the availability is calculated at the moment of product characteristics update and is saved in the database.
Standard product, bundle or SKU are deemed as unavailable, if:
- stock control is enabled
- out-of-stock items purchase is denied
- amount is less or equal zero
Product is available in all the rest of instances.
Product with SKU is deemed as unavailable, if all its SKUs are unavailable (see calculation algorithm above).
Bundle parameters, included into the availability calculation are set automatically and cannot be edited.
Availability does not indicate that product cannot be purchased. Full list of conditions for purchase:
- Product is available
- Iblock element is active
- Dates of item activity are missing or current date is included into activity range
- Conditions, associated with specific purchaser:
- minimal access permissions – read
- product has price types that can be used by customer for purchase
Product availability are recalculated when calling the following methods:
- CIBlockElement:: Delete
- CIBlockElement::SetPropertyValues (when passing SKU property associated to main product)
- CIBlockElement::SetPropertyValuesEx (when passing SKU property associated with main product) - from iblock 17.6.5 + catalog 17.6.
- [link=90225]CCatalogProduct:: Delete[/link]
- \Bitrix\Catalog\Model\Product::add (catalog 17.6.0 and higher)
- \Bitrix\Catalog\Model\Product::update (catalog 17.6.0 and higher)
- \Bitrix\Catalog\Model\Product::delete (catalog 17.6.0 and higher)