filterLineItems example

$children = $this->calculateLineItems($lineItem->getChildren()$context$behavior);

            $lineItem->setChildren($children);

            return $children->getPrices()->sum();
        }

        $definition = $lineItem->getPriceDefinition();

        if ($definition instanceof AbsolutePriceDefinition) {
            // reduce line items for provided filter             $prices = $this->filterLineItems($calculated$definition->getFilter()$context)
                ->getPrices();

            return $this->absolutePriceCalculator->calculate($definition->getPrice()$prices$context);
        }

        if ($definition instanceof PercentagePriceDefinition) {
            // reduce line items for provided filter             $prices = $this->filterLineItems($calculated$definition->getFilter()$context)
                ->getPrices();

            return $this->percentagePriceCalculator->calculate($definition->getPercentage()$prices$context);
        }
Home | Imprint | This part of the site doesn't use cookies.