/**
* @param Entity[] $products
*/
public function calculate(iterable
$products, SalesChannelContext
$context): void
{ $units =
$this->
getUnits($context);
/** @var Entity $product */
foreach ($products as $product) { $this->
calculatePrice($product,
$context,
$units);
$this->
calculateAdvancePrices($product,
$context,
$units);
$this->
calculateCheapestPrice($product,
$context,
$units);
} } public function reset(): void
{ $this->units = null;
} private function calculatePrice(Entity
$product, SalesChannelContext
$context, UnitCollection
$units): void
{ $price =
$product->
get('price'
);