public function AlwaysInStock::createTransaction in Commerce Stock 8
Create a stock transaction.
Parameters
\Drupal\commerce\PurchasableEntityInterface $entity: The purchasable entity.
int $location_id: The location ID.
string $zone: The zone.
float $quantity: Tbe quantity.
float $unit_cost: The unit cost.
string $currency_code: The currency code.
int $transaction_type_id: The transaction type ID.
array $metadata: Holds all the optional values those are:
- related_tid: related transaction.
- related_oid: related order.
- related_uid: related user.
- data: Serialized data array.
Return value
int Return the ID of the transaction.
Overrides StockUpdateInterface::createTransaction
File
- src/
AlwaysInStock.php, line 15
Class
- AlwaysInStock
- The Checker and updater implementation for the always in stock service.
Namespace
Drupal\commerce_stockCode
public function createTransaction(PurchasableEntityInterface $entity, $location_id, $zone, $quantity, $unit_cost, $currency_code, $transaction_type_id, array $metadata) {
// Do nothing and return a NULL value as its N/A.
return NULL;
}