Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - rename the "Apply Coupon" field on the cart page
<?php
// rename the coupon field on the cart page
function woocommerce_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 ( 'Apply Coupon' === $text ) {
$translated_text = 'Apply Promo Code';
}
return $translated_text;
}
add_filter( 'gettext', 'woocommerce_rename_coupon_field_on_cart', 10, 3 );
@DrMTR

This comment has been minimized.

Copy link

@DrMTR DrMTR commented Feb 6, 2017

dont work.

@zakirsajib

This comment has been minimized.

Copy link

@zakirsajib zakirsajib commented Feb 25, 2018

it works. check case of the 'apply coupon'. It might be Apply coupon!

@stifoo

This comment has been minimized.

Copy link

@stifoo stifoo commented Jan 24, 2020

Thanks @zakirsajib, I looked and mine WAS 'Apply coupon'. I changed the case and it worked on the button text!! TY!

@sajjadalis

This comment has been minimized.

Copy link

@sajjadalis sajjadalis commented Apr 22, 2020

Not working. Checked case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment