When removing a product from cart using the Ajax Block in this module it does not seem to trigger the event 'After removing a product from the cart' in rules.

I have noticed this when using Commerce Coupon module and creating a minimum order total requirement for a coupon to be redeemable using rules.

In this situation there needs to be a way to stop a user from adding a coupon when their order total is above the minimal order total required for that coupon, and then removing a product and continuing to checkout, as their order total is now below the minimal order amount, yet the coupon is still active.

I have created a simple Rule to deal with this issue which is as follows

EVENT
After removing a product from the cart

ACTION
Remove all coupons from an order

This does not work when removing an item from the cart (unless doing so on /cart page)

Comments

joe huggans’s picture

Is it simple to invoke this rule ?

subhojit777’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Active » Needs work

Rules for adding product to cart are invoked because we are altering add to cart form. But we are using callback to remove product from cart, in that case the "product removal" hooks/rules are not getting called. I guess we have to invoke them from module.

  • subhojit777 committed 8094f80 on 7.x-1.x
    Issue #2501643 by subhojit777: Removing product from cart block does not...
subhojit777’s picture

Status: Needs work » Fixed

Commit 8094f80 will fix this problem.

  • subhojit777 committed 8094f80 on 7.x-2.x
    Issue #2501643 by subhojit777: Removing product from cart block does not...

Status: Fixed » Closed (fixed)

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