How can I change “Enter Voucher code:” label text on the registration form?
I tried to change this part of the code by going to shopping_cart.php (although it says: inactive) because this is the only place where I found “Enter voucher code” label, but unfortunately it didn’t work.
……………………………………………………………………
This example is ready to go and can be added to your child theme’s functions.php file or a site specific plugin:
function ee_replace_voucher_code_messaging( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'Enter Voucher code' => 'Replace this phrase',
// Add some more strings here
);
// See if the current string is in the $strings array
// If so, replace its translation
if ( isset( $strings[$original] ) ) {
// This accomplishes the same thing as __()
// but without running it through the filter again
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'ee_replace_voucher_code_messaging', 10, 3 );
—
Lorenzo
Viewing 1 reply thread
The support post ‘How to change "Enter Voucher code:" label text?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
If you would like help from the Event Espresso staff, then please purchase a support license right now so you can create a support topic in our premium support forums.