absoluteSurchargeMissingPriceCollection example

throw CartException::invalidPercentageSurcharge($key);
            }

            $value = FloatComparator::cast((float) $value);

            return new PercentagePriceDefinition(abs($value));
        }
        if ($type !== AbsolutePriceDefinition::TYPE) {
            throw CartException::surchargeTypeNotSupported($key$type);
        }
        if (!$value instanceof PriceCollection) {
            throw CartException::absoluteSurchargeMissingPriceCollection($key);
        }
        if (!$value->has(Defaults::CURRENCY)) {
            throw CartException::missingDefaultPriceCollectionForSurcharge($key);
        }

        foreach ($value as $price) {
            $price->setGross(\abs($price->getGross()));
            $price->setNet(\abs($price->getNet()));

            if (!$price->getListPrice()) {
                continue;
            }
Home | Imprint | This part of the site doesn't use cookies.