Support

Home Forums Event Espresso Premium Changing the "Important Notice" on the Thank You registration page

Changing the "Important Notice" on the Thank You registration page

Posted: February 12, 2016 at 10:01 pm

Viewing 7 reply threads


sliceliterary

February 12, 2016 at 10:01 pm

Hi,

I’ve seen a few threads on this topic, which point to using Poedit to update the Important Notice on the Thank You screen after people register. Before I try Poedit, I’m wondering if it’s possible to add a filter to my site specific plugin to make the change. I used a filter to change the pre-approval Important Notice in registration checkout, following these instructions: https://gist.github.com/lorenzocaum/28ccc3b92d38e1dbc046

Is there a similar filter for the Thank You page, or is Poedit the only way to do it? This is the text I want to change:

The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.

Thanks in advance!
Maria


Tony

  • Support Staff

February 13, 2016 at 4:12 am

Hi Maria,

Yes you can use a custom function within the Site Specific Plugin.

You can use the function shown here:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function

Yours would be something like this:

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.' => 'YOUR CUSTOM TEXT HERE',
        // 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 );

Note that you can continue to add strings to that same function if you want to change other strings.


sliceliterary

February 15, 2016 at 5:57 pm

Thanks for your help with this! I am just about there but seem to be doing something wrong. This is exactly what I added to my site specific plugin:

function mycustom_filter_gettext( $translated, $original, $domain ) {
$strings = array(
‘The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.’ => ‘Thank you for applying to our event. You will receive an email confirming receipt of your application, along with details on next steps.’,
);

I got an error message saying “syntax error, unexpected end of file.” Should I change anything here? Do I need to add any of the code below the note that reads “See if the current string is in the $strings array”? That was a bit confusing.

Thanks again,
Maria


Josh

  • Support Staff

February 15, 2016 at 8:24 pm

Hi Maria,

Yes, you will need to copy and paste every line of the code that Tony shared with you.


sliceliterary

February 15, 2016 at 8:32 pm

Ok, thanks. Is anything in here notes? Or I should include absolutely everything? The text from here down confused me:

// See if the current string is in the $strings array
// If so, replace its translation

If these are instructions, I’m not quite sure what to do.


Josh

  • Support Staff

February 15, 2016 at 8:50 pm

You should include everything. There are notes, but the one note that’s for you is the one that says “Add some more strings here”.


sliceliterary

February 17, 2016 at 10:09 pm

It worked! Thanks so much to you both.


Tony

  • Support Staff

February 18, 2016 at 4:05 am

You’re most welcome, Maria 🙂

Viewing 7 reply threads

The support post ‘Changing the "Important Notice" on the Thank You registration page’ 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