I'm not sure I did this correctly after having read through the woocommerce_add_$NOTICE_TYPE
hook. What I want to do is change the Coupon code applied successfully
message into my own custom text like this:
The %coupon_name% promotion code has been applied and redeemed successfully.
But I don't know how to get the coupon name.
add_filter( 'woocommerce_add_notice', function( $message ){
// get the coupon name here
if( $message == 'Coupon code applied successfully.' )
$message = 'The %coupon_name% promotion code has been applied and redeemed successfully.';
return $message;
});