Is this a vanilla implementation - do you have any custom implementation with you promotion, promotion engine or your calculators?
Yes, this is a vanilla implementation. We have added nothing else around it.
You should use IOrderGroupCalculator.GetOrderGroupTotals instead. IOrderGroupTotalsCalculator was obsoleted
We are using Commerce V11 and the documentation for 10-11 says that using IOrderGroupTotalsCalculator is the correct method.
https://world.episerver.com/documentation/developer-guides/archive/commerce/orders/10-11/
I have attempted to use IOrderGroupCalculator.GetOrderGroupTotals but unfortunately its only available in 12+
That's true, I overlooked that.
I would suggest you to contact developer support service for further assistance. As it is right now I can't see why, we might need to look into your site for more insight
I was able to look into your solution and after some debugging, you are using _lineItemCalculator.GetExtendedPrice(lineItem, currency); in your custom ShippingCalculator. ExtendedPrice include the order level discounts, that's why you are seeing double discount. You should have use GetDiscountedPrice - which only takes line item level discount into account.
Hi,
We currently run Commerce V11.2.6.0.
Using the 'Buy Products and Get Discount on Order' discount we get a doubling of the discount that gets applied. First at the subtotal level and then also at the total.
For example, we set up a discount of this type at 10%:
Product 1: $50
Product 2: $50
Product 3: $50
Subtotal: $135 ($150 - 10% discount)
Tax: $13.50 (Australian so it's 10% gst)
Discount: $15
Freight: $10
Total: $143.50 ((subtotal + tax + freight) - $15 discount applied again)
We would expect: $158.5 as the discount has already been applied to the products.
To get the amounts we use IOrderGroupTotalsCalculator.GetTotals(cart); and we get the amounts above. There are no other calculations that we do in code that I know about.
var result = new OrderTotals()
{
ShippingTotal = totals.ShippingTotal,
SubTotal = totals.SubTotal,
TaxTotal = totals.TaxTotal,
Total = totals.Total
};
The product discounts all work correctly, it's just the order discounts that appear incorrectly. Am I thinking about this incorrectly or is this a bug?
Cheers Ben