// Check if a pseudo price is defined and calculates it too.
$price->setCalculatedPseudoPrice( $this->priceCalculatorService->calculatePrice($rule->getPseudoPrice(), $tax, $context) );
// Check if the product has unit definitions and calculate the reference price for the unit.
if($price->getUnit() instanceof Unit && $price->getUnit()->getPurchaseUnit()){