You are here

public function StockServiceConfig::getAvailabilityLocations in Commerce Stock 8

Get locations holding stock.

The locations should be filtered for the provided context and purchasable entity.

Parameters

\Drupal\commerce\Context $context: The context containing the customer & store.

\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity.

Return value

\Drupal\commerce_stock\StockLocationInterface[] List of relevant locations.

Overrides StockServiceConfigInterface::getAvailabilityLocations

1 call to StockServiceConfig::getAvailabilityLocations()
StockServiceConfig::getTransactionLocation in src/StockServiceConfig.php
Get the location for automatic stock allocation.

File

src/StockServiceConfig.php, line 28

Class

StockServiceConfig
The default stock service configuration class. This class does nothing meaningful and act as a stub to fullfil the StockServiceInterface for the AlwaysInStockService.

Namespace

Drupal\commerce_stock

Code

public function getAvailabilityLocations(Context $context, PurchasableEntityInterface $entity) {
  return $this->stockLocations;
}