Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a bug, provide steps to reproduce it
1. Clean install, only make sure variation price is calculated, not default
2. Add product 1 (price $30)
3. Create first promotion "50% Off Prod 1" (Include the discount in the displayed unit price)
4. Create second promotion "-10 from order subtotal" and a coupon.
5. add product to cart, apply coupon, proceed to checkout
Expected results
Actual results
If there's no coupon applied, the product price, subtotal and total are correctly calculated
I'm not sure if this bug is new but right now there's no way to have a promotion for a product + a coupon for the order subtotal.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3268581-5.patch | 1.69 KB | jsacksick |
| |||
Screenshot-202203091458-344x344.png | 22.24 KB | gge | |
Screenshot-202203091450-338x342.png | 18.7 KB | gge | |
Screenshot-202203091449-353x349.png | 23.09 KB | gge |
Comments
Comment #2
jsacksick CreditAttribution: jsacksick at Centarro commentedIndeed! Managed to reproduce the issue, there's something weird happening and it seems a "stale" unit price is accessed at some point from the promotion offer plugin (at least during my tests).
Comment #3
jsacksick CreditAttribution: jsacksick at Centarro commentedThis is actually due to a fix from #3220527: OrderItemPercentageOff should calculate the adjustment amount against the adjusted total price.
Comment #4
jsacksick CreditAttribution: jsacksick at Centarro commentedSo the problem here is that the promotion ""50% Off Prod 1", even if you want it to run before the "10 from order subtotal" promotion, will always run after the coupon based promotion.
That is because commerce applies coupon based promotions first.
So, when the "50% Off Prod 1" promotion gets evaluated, the order item is technically already discounted. So the 50% discount is calculated against the discounted order item total...
Not really sure what to do, because this could be considered as the correct behavior too...
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedI've been thinking about this further, and decided to restore the previous behavior (i.e calculate the percentage amount against the unit price and not the "adjusted" unit price).
Comment #6
jsacksick CreditAttribution: jsacksick at Centarro commented@gge: Please let me know if that fixes your usecase.
Comment #7
gge CreditAttribution: gge commentedJust tried the patch and now I get the expected results. At least for me this is the expected behavior.
Thank you very much~
Comment #10
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted.
Comment #12
loze CreditAttribution: loze commentedIm my case I do want to calculate the percentage price off the adjusted price. Is there a way to do this?