How to rename the coupon field on the Woocommerce checkout page
// rename the coupon field on the checkout page
function woocommerce_rename_coupon_field_on_checkout( $translated_text, $text, $text_domain ) {
// bail if not modifying frontend woocommerce text
if ( is_admin() || ‘woocommerce’ !== $text_domain ) {
return $translated_text;
}
if ( ‘Coupon code’ === $text ) {
$translated_text = ‘Enter custom text for Coupon code box here’;
} elseif ( ‘Apply Coupon’ === $text ) {
$translated_text = ‘Enter custom text for Apply Coupon box here’;
}
return $translated_text;
}
add_filter( ‘gettext’, ‘woocommerce_rename_coupon_field_on_checkout’, 10, 3 );