Active
Project:
Commerce Stock
Version:
8.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2025 at 09:34 UTC
Updated:
1 Jul 2025 at 09:34 UTC
Jump to comment: Most recent
I was confused by some of the parameters that are required by the StockTransactionsInterface::createTransaction method.
/**
* Receive stock.
*
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The purchasable entity (most likely a product variation entity).
* @param int $location_id
* The location ID.
* @param string $zone
* The zone.
* @param float $quantity
* The quantity.
* @param float $unit_cost
* The unit cost.
* @param string $currency_code
* The currency code.
* @param string $message
* The message.
*/
public function receiveStock(PurchasableEntityInterface $entity, $location_id, $zone, $quantity, $unit_cost, $currency_code, $message = NULL);
$unit_cost and $currency_code needed? Is it purely for logging, or is it going to have an impact on sales figures?Appreciate that answers can probably be worked out by examining the code base but it would be helpful documenting in code, in my opinion.
Comments