Skip to content

Instantly share code, notes, and snippets.

@wisecrab
Created August 25, 2015 13:17
Show Gist options
  • Select an option

  • Save wisecrab/50808eb76a9e02488a12 to your computer and use it in GitHub Desktop.

Select an option

Save wisecrab/50808eb76a9e02488a12 to your computer and use it in GitHub Desktop.
//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 = 'MY_NEW_TEXT_HERE';
}
return $translated_text;
}
add_filter( 'gettext', 'woocommerce_rename_coupon_field_on_cart', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment