Support

Home Forums Event Espresso Premium Change Registration Instruction Text – Registration Checkout

Change Registration Instruction Text – Registration Checkout

Posted: October 9, 2017 at 12:01 pm

Viewing 2 reply threads


sogtalks@gmail.com

October 9, 2017 at 12:01 pm

Hi,

I would like to update the text instructions regarding must login…on the Registration Checkout page.
Based on goo.gl/P3x7R5 I have tried the following

function registration_login_text_filter_gettext( $translated, $original, $domain ) {
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'The event you have selected requires logging in before you can register.' => 'You must login as a Member to register or purchase guest tickets for an event.',
        'You can %sregister for an account here%s if you don\t have a login.' => 'You can %sregister for a Membership here%s if you don\'t have one.',
        // 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', 'registration_login_text_filter_gettext', 10, 2 );

No change on page.

Thank you.


Tony

  • Support Staff

October 10, 2017 at 3:43 am

Hi there,

You’ve split the strings in the above but within the code it’s actually a single string:

'The event you have selected requires logging in before you can register. You can %sregister for an account here%s if you don\'t have a login.' => 'You must login as a Member to register or purchase guest tickets for an event. You can %sregister for a Membership here%s if you don\'t have one.',

For translations to work the current string must match exactly so the above should work.


sogtalks@gmail.com

October 10, 2017 at 11:27 am

Perfect. That works and I should have known that. Thank you Tony.

Viewing 2 reply threads

The support post ‘Change Registration Instruction Text – Registration Checkout’ 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