I’m looking for a way to remove a coupon code from a users cart during the onestepcheckout process. Specifically, if the user enters a country that is not the USA then I’d like to remove our freeship coupon if it is set and replace it with one that offers a discount on the shipping price for the international order.
I can write all of the rest of the code, basically I’m just looking for a function that allows me to remove a set coupon code in the checkout process (if the code to add a new coupon is much different that would be helpful too).
I don’t know how onestepcheckout work, but in onepage checkout, you can capture event “checkout_controller_onepage_save_shipping_method” and set coupon code like bellow:
put above method to your observer class and modify config.xml to capture event.