Home Forums Event Espresso Premium Checkout page: need to change strings

Checkout page: need to change strings

Posted: June 1, 2020 at 3:59 pm


June 1, 2020 at 3:59 pm

Need to change ‘Expiry Month’ => ‘Expiriation Month’ but the nmethod featured in seems to work for strings inside the normal display of EE but not necessarily in the checkout page. Any suggestions?


  • Support Staff

June 1, 2020 at 5:34 pm


Based on ‘Expiry Month’ I’m assuming this is on the payment options?

If so, which payment method is this on?

If it’s not on the payment options can you add a screenshot so I can see where this show please?


June 2, 2020 at 8:01 am
FirstData PayEezy


June 2, 2020 at 8:20 am

Oops. That URL is bad. Use this one:


  • Support Staff

June 2, 2020 at 8:35 am

Yeah ok so thats within the payment method itself, but the above function works fine for changing that string.

That is just from adding 'Expiry Month' => 'Expiry Month TONY', to the $strings array on that function.

Are you adding it to your theme’s functions.php or a custom functions plugin as it likely needs to go in the latter:


June 2, 2020 at 9:49 am

Ok, I’ve made a plugin and it behaves like a plugin.
it doesn’t seem to do what you did above. Here is the code:

/* Function to swap out text strings site wide */
function mycustom_filter_gettext( $translated, $original, $domain ) {
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Sold Out' => 'Full',
		'Expiry' => 'Expiration',
        // 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', 'mycustom_filter_gettext', 10, 3 );

/*end function to swap out text strings site wide */

Do I need to do something with the domain declaration?


  • Support Staff

June 2, 2020 at 1:57 pm

You need to use the whole string when translating.

So you can’t translate just ‘Expiry’ within ‘Expiry Month’, you need to translate the full string, it’s just how translations work.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 4 months, 4 weeks ago ago

Topic Tags


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!