Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WC change coupon messages
<?php
// 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' );
break;
case $coupon::WC_COUPON_REMOVED :
$msg = __( 'Promo code removed successfully.', 'my-textdomain' );
break;
}
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
You can’t perform that action at this time.