calculateFixedDiscount example

$discountMaxValue = $discountLineItem->getPayloadValue('maxValue');
                }

                $discountAdded = $this->calculatePercentage($deliveries$originalPriceDefinition$context$discountMaxValue);

                break;
            case PromotionDiscountEntity::TYPE_FIXED_UNIT:
                if (!$originalPriceDefinition instanceof AbsolutePriceDefinition) {
                    throw new InvalidPriceDefinitionException((string) $discountLineItem->getLabel()$discountLineItem->getReferencedId());
                }

                $discountAdded = $this->calculateFixedDiscount($deliveries$originalPriceDefinition$context$notDiscountedShippingCosts);

                break;
        }

        return $discountAdded;
    }

    /** * calculate the discount on all deliveries for a discount of type absolute */
    private function calculateAbsolute(DeliveryCollection $deliveries, AbsolutePriceDefinition $definition, SalesChannelContext $context): bool
    {
Home | Imprint | This part of the site doesn't use cookies.