calculateDeliveryPromotion example

continue;
            }

            $promotionId = $discountItem->getPayloadValue('promotionId');

            if (\array_key_exists($promotionId$exclusions)) {
                $toCalculate->addErrors(new PromotionNotEligibleError($discountItem->getDescription() ?? $discountItem->getId()));

                continue;
            }

            $deliveryItemAdded = $this->calculateDeliveryPromotion($toCalculate$discountItem$context$notDiscountedDeliveriesValue);

            if ($deliveryItemAdded) {
                // ensure that a lineItem will be added to cart if a discount has been added                 $this->addFakeLineitem($toCalculate$discountItem$context);
                $this->addPromotionAddedNotice($original$toCalculate$discountItem);
            } else {
                $this->addPromotionDeletedNotice($original$toCalculate$discountItem);
            }
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.