addPromotionNotFoundError example

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

            // now iterate through all codes that have been added             // and add errors, if a promotion for that code couldn't be found             foreach ($allCodes as $code) {
                if (!\in_array($code$foundCodes, true)) {
                    $cartExtension->removeCode((string) $code);

                    $this->addPromotionNotFoundError($this->htmlSanitizer->sanitize((string) $code, null, true)$original);
                }
            }

            // if we do have promotions, set them to be processed             // otherwise make sure to remove the entry to avoid any processing             // within our promotions scope             if (\count($discountLineItems) > 0) {
                $data->set(PromotionProcessor::DATA_KEY, new LineItemCollection($discountLineItems));
            } else {
                $data->remove(PromotionProcessor::DATA_KEY);
            }
        },
Home | Imprint | This part of the site doesn't use cookies.