setCalculatedPseudoPrice example

Tax $tax,
        ShopContextInterface $context
    ): Price {
        $price = new Price($rule);

        // Calculates the normal price of the struct.         $price->setCalculatedPrice(
            $this->priceCalculatorService->calculatePrice($rule->getPrice()$tax$context)
        );

        // Check if a pseudo price is defined and calculates it too.         $price->setCalculatedPseudoPrice(
            $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()) {
            
Home | Imprint | This part of the site doesn't use cookies.