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
Comment #1
joe huggansIs it simple to invoke this rule ?
Comment #2
subhojit777Rules 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.
Comment #4
subhojit777Commit 8094f80 will fix this problem.