Commerce: order total discount is calculated wrong?

Hi community!

We seem to have encountered a potential issue with discount calculations in Umbraco Commerce V13.

Scenario (see image):

  • We have a product with an original price of approximately €1,652.07.
  • The product itself is already discounted and displayed in the order at €1,288.61.
  • Shipping costs are €9.50
  • A 15% discount is then applied on the order total.

Expected behavior:
The 15% discount should be calculated based on the current visible order total (€1,298.11 including shipping) or at least based on the already discounted product price.

Actual behavior:
The discount amount is calculated using the original product price instead:

  • €1,652.07 + €9.50 = €1,661.57
  • 15% of this = €249.24

This results in a “Net Total Discount” of €249.24, even though the visible net total before discount is only €1,298.11.

Because of this, the discount shown in the totals does not match the displayed order values and appears inconsistent to the customer.

It looks like Umbraco Commerce is calculating the discount using the original order line price rather than the adjusted/current order line total.

Can anyone confirm whether this is expected behavior or potentially a bug?

Note: we have no custom logic which recalculated the state of subtotal, shipping or total. The only adjustment is the order line discount, which is applicable. I think this is not the problem because the order total (with the order line adjustments) of €1,298.11 is calculated correctly.

Greetings,
Joppe

Hi @JoppeRuessink

I think what you are seeing is by design, as you point out the discounts are being applied to the original price not the discounted price.

I’m not sure on the solution, but I have asked AI it this is the response:

The behaviour you’re seeing is expected rather than a bug — it comes down to how Commerce layers adjustments.

Commerce distinguishes between an order line’s price and its adjustments. Your product discount is almost certainly applied as an adjustment, so the order line’s underlying price still reports €1,652.07, with the discount sitting on top to produce the visible €1,288.61.

Order-level discounts calculate against the subtotal price before adjustments, not the adjusted/visible total. So your 15% computes against €1,652.07 + €9.50 = €1,661.57 = €249.24, exactly as you worked out. Adjustments are stacked independently against the base price rather than applied sequentially — by design, so discount order doesn’t change the result and each adjustment stays auditable.

If you want the order discount to apply to the already-discounted figure, the cleanest route is to make the product discount a genuine price change (via custom price calculator logic so the unit price itself becomes the lower value) rather than an adjustment. Order-level discounts then naturally calculate off the lower base.

Worth confirming: how is that €1,288.61 being produced — a discount rule, custom calculator, or manual adjustment? That determines your options. The total of €1,298.11 is correct and €249.24 is internally consistent; the real issue is that it reads oddly to customers, which is a presentation/expectation mismatch rather than a maths error.

If it turns out the adjustment is being applied in an unexpected order, that’d be worth raising on the Umbraco.Commerce.Issues tracker with a minimal repro.

I hope that helps.

Justin