#10923
Soft79
Keymaster

You can remove the $woocommerce->cart->remove_coupon(sanitize_text_field($coupon_id)); from your snippet.

The default message is “Sorry, coupon “%s” is only valid on your first purchase”. If you want to make this message dynamic, you can use the woocommerce_coupon_message filter.