Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.
twenty percent off and fifteen dollars off
- Cart total
- $120.00
- Percentage coupon
- 20%
- Flat amount coupon
- $15.00
- Apply first
- Percentage
- Shipping
- $0.00
Best achievable price$81.00
Percentage first: 120 x 0.8 = 96, less 15, is 81. Flat first: 105 x 0.8 = 84. The 3 difference is exactly 20% of the 15 voucher, which is the general result and the reason order matters.
Open this exampleno flat coupon makes order irrelevant
- Cart total
- $120.00
- Percentage coupon
- 20%
- Flat amount coupon
- $0.00
- Apply first
- Percentage
- Shipping
- $0.00
Best achievable price$96.00
boundary: with nothing for the percentage to be applied before or after, both orders give 120 x 0.8 = 96
Open this exampleno coupons is the cart total
- Cart total
- $120.00
- Percentage coupon
- 0%
- Flat amount coupon
- $0.00
- Apply first
- Percentage
- Shipping
- $0.00
Best achievable price$120.00
degenerate case: nothing applied leaves the cart exactly as it was
Open this example