Support

Home Forums Event Espresso Premium Change Thank you Text

Change Thank you Text

Posted: August 21, 2017 at 7:52 am

Viewing 3 reply threads


dbcfound

August 21, 2017 at 7:52 am

Hi there! I am attempting to update the text in the yellow box, on the Thank you page, using the support found here: https://eventespresso.com/topic/changing-the-important-notice-on-the-thank-you-registration-page/.

Below is text that I’ve included in my theme function.php. But, it is not translating the text. What am I doing wrong?

function mycustom_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Check your email for your registration confirmation or click the button’ => ‘Click the button’,
// 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 );

I was able to use the following to change the text in the button …also, in the function.php of my theme.

function tw_ee_button_confirmation_text() {
return ‘View Confirmation’;
}
add_filter( ‘FHEE__thank_you_page_overview_template__order_conf_button_text’, ‘tw_ee_button_confirmation_text’ );


Tony

  • Support Staff

August 21, 2017 at 8:17 am

Hi there,

When you use the translation function above you need to set the full string, within EE there is no:

‘Check your email for your registration confirmation or click the button’

It is part of this string:

‘%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.’

So to translate that you would need:

$strings = array(
	'%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.' => '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sClick the button to view / download / print a full description of your purchases and registration information.',
	// Add some more strings here
);


dbcfound

August 21, 2017 at 8:30 am

Ah ha! I was trying to be slick and leave out some of the phrase. Thank you so much!


Tony

  • Support Staff

August 21, 2017 at 8:59 am

You’re most welcome 🙂

Viewing 3 reply threads

The support post ‘Change Thank you 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.

Event Espresso