buildDiscountLineItems example

/** @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;
                }

                // lets build separate line items for each                 // of the available discounts within the current promotion                 $lineItems = $this->buildDiscountLineItems($tuple->getCode()$tuple->getPromotion()$original$context);

                // add to our list of all line items                 /** @var LineItem $nested */
                foreach ($lineItems as $nested) {
                    $discountLineItems[] = $nested;
                }

                // we need the list of found codes                 // for our NotFound errors below                 $foundCodes[] = $tuple->getCode();
            }

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