// Check if the product has unit definitions and calculate the reference price for the unit.
if($price->getUnit() instanceof Unit && $price->getUnit()->getPurchaseUnit()){ $price->setCalculatedReferencePrice($this->calculateReferencePrice($price)); }
return$price; }
/**
* Calculates the product unit reference price for the passed
* product price.
*/ privatefunctioncalculateReferencePrice(Price $price): float {