I am having issues with getting the correct saved amount from PromotionInfromation. I have written some complicated code to get around it, but I would like to not have to use my workaround as it is fragile.
Here is my example:
I have an order with 2 percentage line item discounts and then 1 order level discount. When I run the engine and get the list of RewardDescriptions back I see the correct saved amounts for all three discounts, but when I get the list of PromotionInformation off the form the second line item discount appears to have the the first one included in the saved amount. In different cases the numbers get very complicated and dont reflect the same numbers from RewardDescriptions.
Here are the numbers from RewardDescriptions:
Line item discount 1 - 10.299% saved $19.26
Line item discount 2 - 8.2% saved $13.75
Order Level discount 3 - Saved $46.5
And now the numbers from PromotionInformations:
Line item discount 1 - Saved $19.26
Line item discount 2 - Saved $33.01
I am running Epi Commerce 10.4
That is the way it was designed. We talked about it once about making each PromotionInformation contains only the discount it gave but for some reasons (which I forgot) we decided to keep it as is. So the answer is just no.
Not related but 10.4 is very old. We highy recommend to upgrade to at least 12.17
Well it seems to be not very straight forward to extract promotion information.
What you're writing, Quan, seems to be true sometimes but not all the time. At least in Commerce 11.8.5 that we're currently running.
We have 1 lineitem with 1 qty, the cost is 649.We have 1 promotion that is applied which gives a fixed price of 300We have another promotion giving 22% discount on that lineitem as well
cart.GetFirstForm().Promotions will contain two rows. The first one with a SavedAmount of 349, and the second one with a SavedAmount of 415.
415-349 is 66, which is 22% of 300. So that is correct. And the order total is also correct.
But when we change the lineitem quantity to 2 instead we still get 2 promotions, the first one with SavedAmount of 698, the second one with a SavedAmount of 66. So this time the second PromotionInformation only contains its own discount, not the stacked total.
Are there any known bugs related to this in Commerce 11? Any other way to extract the promotion information? There seems to be no data available to indicate if the savedamount are stacked or individual.