"Percentage off the order subtotal" uses total before discounts, not actual subtotal

Created on 4 February 2024, 8 months ago
Updated 5 February 2024, 8 months ago

Describe your bug or feature request.

When an order has a "Percentage off the order subtotal" discount applied, I would expect the amount of the discount to be calculated based on the Subtotal shown for the order. However, if other promotions have reduced the Subtotal, the actual percentage off is calculated without taking those reductions into account.

This means that when multiple promotions including "Percentage off the order subtotal" are applied to an order, the customer may be given a larger discount than intended.

If a bug, provide steps to reproduce it from a clean install.

Configuration:

  • Create a product variation with price of $100.
  • Create a promotion called "30% off product" — "Percentage off each matching product", 30%, "Include the discount in the displayed unit price", "Specific product variation"
  • Create a promotion called "20% off subtotal" — "Percentage off the order subtotal", 20%, create coupon
  • Create a promotion called "10% off subtotal" — "Percentage off the order subtotal", 10%, create coupon

Test 1:

  • Add product to cart.
  • Add coupon for 10% off subtotal.
    • Subtotal = $70.00 (OK)
    • 10% off subtotal = -$10.00 (incorrect: should be -$7.00)
    • Total = $60.00 (incorrect)

Test 2:

  • Continuing with the above cart…
  • Add coupon for 20% off subtotal.
    • Subtotal = $70.00 (OK)
    • 10% off subtotal = -$10.00 (incorrect: should be -$7.00)
    • 20% off subtotal = -$20.00 (incorrect: should be either -$14.00 or -$12.60)
    • Total: $40.00 (incorrect)
🐛 Bug report
Status

Closed: duplicate

Version

2.37

Component

Discount

Created by

🇺🇸United States jlstrecker Athens, Ohio, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jlstrecker
  • Status changed to Closed: duplicate 8 months ago
  • 🇮🇱Israel jsacksick

    Handling stacked promotions has always been tricky...
    Regarding:

    Create a promotion called "30% off product" — "Percentage off each matching product", 30%, "Include the discount in the displayed unit price", "Specific product variation"

    The problem is coupon based promotions always apply first, which means the order subtotal is not yet reduced whenever the coupon based promotions apply.
    This would be solved if the non based promotion would apply prior to the other ones... Changing the weight isn't going to work... There's already open bug reports for this behavior...

    See 🐛 Promotion weight is not respected if applied via coupon Active . Marking this bug report as a duplicate.

Production build 0.71.5 2024