You are here

public function StockTransactionsInterface::getTransactionLocation in Commerce Stock 8

Get the location to be used for automatic stock allocation.

This is normally done by calling the stock service StockServiceConfigInterface getTransactionLocation() and is provided as a util function.

Parameters

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

\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity (most likely a product variation entity).

int $quantity: The quantity.

Return value

\Drupal\commerce_stock\StockLocationInterface The stock location.

1 method overrides StockTransactionsInterface::getTransactionLocation()
StockServiceManager::getTransactionLocation in src/StockServiceManager.php
@todo code sniffer error here, can't have optional params first.

File

src/StockTransactionsInterface.php, line 66

Class

StockTransactionsInterface
Defines a common interface for creating stock transactions.

Namespace

Drupal\commerce_stock

Code

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