PriceNotFoundException example

/** * Gets the price collection of all cart items in this package. * * @throws PriceNotFoundException */
    public function getAffectedPrices(): PriceCollection
    {
        $affectedPrices = new PriceCollection();

        foreach ($this->cartItems as $lineItem) {
            if ($lineItem->getPrice() === null) {
                throw new PriceNotFoundException($lineItem);
            }

            $affectedPrices->add($lineItem->getPrice());
        }

        return $affectedPrices;
    }

    /** * @return array<string, LineItem> */
    
Home | Imprint | This part of the site doesn't use cookies.