This code fully works, and unlike a few others codes the link to the checkout works. This is a mashup of snippets that works.
add this to your functions.php file and it will find the word ‘Coupon’ and change it to ‘Voucher’.
//change coupon to voucher - codehaven snippet
add_filter( 'gettext', 'fix_woocommerce_strings', 999, 3 );
add_filter( 'gettext', 'bt_rename_coupon_field_on_cart', 10, 3 );
add_filter( 'woocommerce_coupon_error', 'bt_rename_coupon_label', 10, 3 );
add_filter( 'woocommerce_coupon_message', 'bt_rename_coupon_label', 10, 3 );
add_filter( 'woocommerce_cart_totals_coupon_label', 'bt_rename_coupon_label',10, 1 );
function bt_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) {
// bail if not modifying frontend woocommerce text
if ( is_admin() || 'woocommerce' !== $text_domain ) {
return $translated_text;
}
if ( 'Coupon:' === $text ) {
$translated_text = 'Voucher Code:';
}
if ('Coupon has been removed.' === $text){
$translated_text = 'Voucher code has been removed.';
}
if ( 'Apply coupon' === $text ) {
$translated_text = 'Apply Voucher';
}
if ( 'Coupon code' === $text ) {
$translated_text = 'Voucher Code';
}
return $translated_text;
}
function bt_rename_coupon_label( $err, $err_code=null, $something=null ){
$err = str_ireplace("Coupon","Voucher Code ",$err);
return $err;
}
add_filter( 'woocommerce_checkout_coupon_message', 'bbloomer_have_coupon_message');
function bbloomer_have_coupon_message() {
return ' Have a Voucher? Click here to enter your Voucher code';
}











