setCalculatedReferencePrice example

$this->priceCalculatorService->calculatePrice($rule->getPseudoPrice()$tax$context)
        );

        if ($rule->getRegulationPrice()) {
            $price->setCalculatedRegulationPrice(
                $this->priceCalculatorService->calculatePrice($rule->getRegulationPrice()$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()) {
            $price->setCalculatedReferencePrice($this->calculateReferencePrice($price));
        }

        return $price;
    }

    /** * Calculates the product unit reference price for the passed * product price. */
    private function calculateReferencePrice(Price $price): float
    {
        
Home | Imprint | This part of the site doesn't use cookies.