Change record status: 
Project: 
Introduced in branch: 
8.x-2.x
Introduced in version: 
8.x-2.19
Description: 

Drupal Commerce launched with an AvailabilityManager API that determined if a "purchasable entity" was available for sale or not. As a feature of the base Commerce module, it has no context of the current order, making it difficult for users of the API to determine availability for any but the most basic use cases.

In 8.x-2.19 we moved the AvailabilityManager API to the Order module, deprecating the commerce.availability_manager service in favor of the commerce_order.availability_manager service. The new AvailabilityManager now receives a full order item as context for determining availability, which contains the purchasable entity and order.

This also means we are deprecating Drupal\commerce\AvailabilityCheckerInterface in favor of Drupal\commerce_order\AvailabilityCheckerInterface. If you have any availability checkers implementing the former interface, you will see deprecation notices.

The new AvailabilityManager API also adds the Drupal\commerce_order\AvailabilityResult value object. Checkers in the new API return result objects that let you describe why a purchasable entity is not available.

Impacts: 
Module developers