You are here

public function StockServiceConfigInterface::getTransactionLocation in Commerce Stock 8

Get the location for automatic stock allocation.

This is normally a designated location to act as the main warehouse. This can also be a location worked out in realtime using the provided context (order & customer), entity and the quantity requested.

Parameters

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

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

int $quantity: The quantity.

Return value

\Drupal\commerce_stock\StockLocationInterface The stock location.

2 methods override StockServiceConfigInterface::getTransactionLocation()
LocalStockServiceConfig::getTransactionLocation in modules/local_storage/src/LocalStockServiceConfig.php
Get the location for automatic stock allocation.
StockServiceConfig::getTransactionLocation in src/StockServiceConfig.php
Get the location for automatic stock allocation.

File

src/StockServiceConfigInterface.php, line 30

Class

StockServiceConfigInterface
The stock service configuration interface.

Namespace

Drupal\commerce_stock

Code

public function getTransactionLocation(Context $context, PurchasableEntityInterface $entity, $quantity);