Support

Home Forums Event Espresso Premium Changing the working of "event registration is past"

Changing the working of "event registration is past"

Posted: September 27, 2013 at 3:59 pm


Carol Stambaugh

September 27, 2013 at 3:59 pm

I need to change the wording that shows up in the yellow box that says, “We are sorry but registration for this event is now closed.” I cannot find where to change this message. Can you point me in the right direction?

Thanks,
Carol


Sidney Harrell

September 27, 2013 at 4:26 pm

The easiest way is probably to use the code found here: https://gist.github.com/sethshoultes/5650757 by adding it to your theme’s functions.php file. You’ll add the string to be replaced on the left of the => and the replacement string on the right of it.


Carol Stambaugh

September 27, 2013 at 4:43 pm

Okay, I made those changes. Here is the url.
http://nasw-wa.org/event-registration/?regevent_action=register&event_id=4

I added the code to the functions.php of the magazine (child theme – using genesis).

I added a new string that has the bad text on the left and then replaced it. Here is exactly what I added and it isn’t working.

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

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Register’ => ‘Sign up’,
‘Confirm and go to payment page’ => ‘Complete registration’,
‘We are sorry but registration for this event is now closed.
Please contact us if you would like to know if spaces are still available.’ => ‘We are sorry but online registration for this event is now closed.
If you still want to register please contact the chapter office at 206-706-7084.’,
// Add some more strings here
);

// See if the current string is in the $strings array
// If so, replace it’s 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 );


Josh

  • Support Staff

September 27, 2013 at 5:11 pm

Hi Carol,

It turns out that the registration closed message is two separate strings. They are:

We are sorry but registration for this event is now closed.

and

Please <a href="contact" title="contact us">contact us</a> if you would like to know if spaces are still available.

In order for the gettext filter to work the strings must match in the function exactly.


Carol Stambaugh

September 27, 2013 at 5:21 pm

Getting closer. The first part worked, but not the second part with the phone number. I checked the code in inspect element and I am pretty sure I have the string exactly correct.

redacted – Event Espresso support team – LOC


Josh

  • Support Staff

September 27, 2013 at 5:38 pm

I think I see why.

That last string shows up in a few places within the plugin code. While the above one should work for the multi-event-registration, the single registration is different. It has the links (correctly) outside of the translation string. So in this case you will need to edit the template file directly in order to remove the link. If you look in event-espresso/templates/registration_page_display.php on line 71.


Carol Stambaugh

September 27, 2013 at 6:21 pm

Boom. There it is. Thank you.

The support post ‘Changing the working of "event registration is past"’ 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