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);
} } } /**
* This function builds a complete list of promotions
* that are excluded somehow.
* The validation which one to take will be done later.
*
* @return array<mixed, boolean>
*/