getEligiblePromotionsWithDiscounts example

$allCodes = array_unique(array_merge(array_values($cartCodes)$extensionCodes));

            $allPromotions = $this->searchPromotionsByCodes($data$allCodes$context);

            if (!$behavior->hasPermission(self::SKIP_AUTOMATIC_PROMOTIONS)) {
                // add auto promotions                 $allPromotions->addAutomaticPromotions($this->searchPromotionsAuto($data$context));
            }

            // check if max allowed redemption of promotion have been reached or not             // if max redemption has been reached promotion will not be added             $allPromotions = $this->getEligiblePromotionsWithDiscounts($allPromotions$context->getCustomer());

            $discountLineItems = [];
            $foundCodes = [];

            /** @var PromotionCodeTuple $tuple */
            foreach ($allPromotions->getPromotionCodeTuples() as $tuple) {
                // verify if the user might have removed and "blocked"                 // the promotion from being added again                 if ($cartExtension->isPromotionBlocked($tuple->getPromotion()->getId())) {
                    continue;
                }

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