Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WC change coupon messages
// only copy opening PHP tag if needed
// Changes the default WooCommerce coupon messages
function sww_change_wc_coupon_message( $msg, $msg_code, $coupon ) {
switch ( $msg_code ) {
case $coupon::WC_COUPON_SUCCESS :
$msg = __( 'Promo code applied successfully.', 'my-textdomain' );
case $coupon::WC_COUPON_REMOVED :
$msg = __( 'Promo code removed successfully.', 'my-textdomain' );
return $msg;
add_filter( 'woocommerce_coupon_message', 'sww_change_wc_coupon_message', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment