How much money each promotion saves

  • Updated
When using the new promotion engine, there is an issue with determining how much money each promotion saves using the PromotionInformation.SavedAmount. However, it seems this amount is compounded in case of multiple promotions. 
 
How do you properly get the amount saved for each promotion.
 

It is only possible to retrieve the SavedAmount that is the total of all discounts for each type, not for each discount separately. 

That's means you can only retrieve the total of SavedAmount for order, line item and shipping discounts.

For example If you have 3 discounts and they are all the line item level then it is not possible to retrieve the SavedAmount for each of them, you can only retrieve the total SavedAmount of them.

You can use the following code to retrieve SavedAmount for each discount type:
IOrderGroupCalculator.GetOrderDiscountTotal() => retrieve SavedAmount of total order discounts

IShippingCalculator.GetShipmentDiscountPrice() => retrieve SavedAmount of shipping discount for 1 shipment

For the line item, you will need to customize the line item calculator. If you use your default built-in, you can use: item.PlacedPrice * item.Quantity - ILineItemCalculator.GetDiscountedPrice (item, curency) .Amount.