Last active
April 1, 2021 15:14
-
-
Save xlplugins/e64da2a0780f38e6c53832e0603ae05a to your computer and use it in GitHub Desktop.
Coupon Code Label Change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'gettext', 'woocommerce_rename_coupon_message_on_checkout' ,10,3); | |
// rename the coupon field on the checkout page | |
function woocommerce_rename_coupon_message_on_checkout( $translated_text, $text, $text_domain ) { | |
// bail if not modifying frontend woocommerce text | |
if ( is_admin() || 'woocommerce' !== $text_domain ) { | |
return $translated_text; | |
} elseif ( 'Apply coupon' === $text ) { | |
$translated_text = 'Special Code'; | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment