mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
13 lines
549 B
Text
13 lines
549 B
Text
add_filter( 'woocommerce_coupon_message', 'filter_woocommerce_coupon_message', 10, 3 );
|
|
function filter_woocommerce_coupon_message( $msg, $msg_code, $coupon ) {
|
|
// $applied_coupons = WC()->cart->get_applied_coupons(); // Get applied coupons
|
|
|
|
if( $msg === __( 'Coupon code applied successfully.', 'woocommerce' ) ) {
|
|
$msg = sprintf(
|
|
__( "The %s promotion code has been applied and redeemed successfully.", "woocommerce" ),
|
|
'<strong>' . $coupon->get_code() . '</strong>'
|
|
);
|
|
}
|
|
|
|
return $msg;
|
|
}
|