if (abs($result->
getPrice()->
getTotalPrice()) === 0.0
) { continue;
} // use our calculated price
$discountItem->
setPrice($result->
getPrice());
// also add our discounted items and their meta data
// to our discount line item payload
$discountItem->
setPayloadValue( 'composition',
$this->discountCompositionBuilder->
buildCompositionPayload($result->
getCompositionItems()) );
// add our discount item to the cart
$calculated->
add($discountItem);
$this->
addPromotionAddedNotice($original,
$calculated,
$discountItem);
// recalculate for every new discount to get the correct
// prices for any upcoming iterations
$this->
calculateCart($calculated,
$context);
} }