When adding more products to the cart the "granted amount" is wrong. It is correct on the calculation, so the amount needed to be paid is correct, but wrong in the button of the page. See attached screenshots.

Comments

brunorios1’s picture

i can confirm this bug...

the granted amount isn't updated if the cart value is changed after the coupon was used.

jonathan_hunt’s picture

Status: Active » Needs review
StatusFileSize
new1.99 KB

I can confirm this issue. Attached is a patch that rewrites commerce_coupon_pct_commerce_coupon_granted_amount_alter(). The current version tries to calculate the amount for a coupon redemption based on order line items but I can't see that there is any way to incorporate the line item quantity so the value is incorrect. The attached patch simply reuses the coupon total from the commerce order total.

I'm not sure if this is the best way forward but it seems to work for me.

brunorios1’s picture

worked here!
thanks!

pcambra’s picture

StatusFileSize
new1.31 KB

I can't reproduce the problem. Anyways I like the spirit of the patch which is lighter.

Could you guys test this version? works for me.

jonathan_hunt’s picture

Status: Needs review » Reviewed & tested by the community

Did you ensure you had quantity > 1 for the product line item?
Anyway, your patch works for me.

pcambra’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks guys!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.