Hi,
I would recommend you to do it simplier.
Just create a coupon with no restrictions and the "auto load in cart if possible" setting activated.
That way, by default, the coupon will always be added to all the carts.
Then, in the onBeforeCouponCheck( &$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do ) trigger, you can check if the conditions are met.
If yes, then you can set the $coupon->discount_flat_amount variable.
If no, you can set $do to false.
That way the coupon is auto added and auto removed and the user doesn't have to do anything.
Regardless, with the method you talked about before, I maintain that onBeforeCartSave or onAfterCartSave are called when you delete coupon from checkout page (click on trash icon).
It's not possible is doesn't, as I explained already in my previous message:
When you do any action in the "coupon" view of your checkout, the validate function of the file administrator/components/com_hikashop/helpers/checkout/coupon.php is called.
There, if a coupon is added the function addCoupon is called, and if a coupon is removed the function removeCoupon is called.
Both are in the file administrator/components/com_hikashop/classes/cart.php and both functions finish by calling the "save" function of the same class. And the save function of administrator/components/com_hikashop/classes/cart.php will call onBeforeCartSave nor onAfterCartSave.
If you think it doesn't, it's probably the way you test if it does or not which is wrong.
For example, if you set a value in a variable somewhere during onAfterCartSave and then you expect to be able to read it in onAfterCartProductsLoad, that won't happen as onAfterCartSave is called during the AJAX request to remove the coupon, while onAfterCartProductsLoad will be called when refreshing the HTML of the different areas of the checkout.
So since these are done with different AJAX requests they won't share the variables data.
Now I don't know what you did you check if onAfterCartSave was called when a coupon is removed. I can only tell you that it is called and the problem is probably in the way you're testing that.
To make sure, you can do it like that:
function onAfterCartSave(&$cart) {
if(isset($cart->cart_coupon)) hikashop_writeToLog('coupon is now: '.$cart->cart_coupon);
}