Support

Home Forums Event Espresso Premium Suggested feature: ability to change the term "Tickets" and "Attendees"

Suggested feature: ability to change the term "Tickets" and "Attendees"

Posted: September 14, 2014 at 3:49 pm

Viewing 5 reply threads


benjamin b

September 14, 2014 at 3:49 pm

In addition to attendees, I’m setting up EE4 to accept registration of table space for vendor and exhibitors. It looks a little funny when Attendee Registration shows at the top of the page during checkout instead of something like “Vendor Registration”, and choosing a number of “Tickets” rather than number of “Tables” or “Space” etc. Be nice to be able to set these for specific events in the settings.


Lorenzo Orlando Caum

  • Support Staff

September 14, 2014 at 4:10 pm

Hi, that can be done by using a translation plugin like Quick Localization or Loco Translate. You could also use a gettext filter:

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


Lorenzo


benjamin b

September 15, 2014 at 12:37 am

Thanks, I have been able to change the necessary text by adding the suggested code to my theme’s functions.php file. HOWEVER, I need to have this fire only when it is for a specific event name, eg. “Vendor Registration for the Summit”. Could you suggest some code I can use in functions.php to check the event name or another way change text for a specific event? If this is not possible, perhaps I could send vendors to register on a different hostname eg vendors.mydomain.com which would still point to the same wordpress install but the hostname global could be used to determine which espresso event to change text for.


Dean

September 15, 2014 at 2:00 am

Hi,

You could try an if statement similar to the is_singular (I would say use is_single() ) as described here: http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext#Change_the_Comment_Form

HOWEVER, my test site did not like this at all and threw fatal errors, you may get more mileage out of it, but I would suggest testing this on a development server first.


benjamin b

September 16, 2014 at 4:43 pm

I’ve been able to use $_POST[‘tkt-slctr-event-id’] to determine which event the checkout is for. However, I’m finding this strange behavior…

Here’s what should work:

$tkt_slctr_event_id=$_POST[‘tkt-slctr-event-id’];
if ($tkt_slctr_event_id==”254″) {

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

$strings = array(
‘Attendee%sInformation’ => ‘Exhibitor Information’,
‘%s Attendee Information’ => ‘%s Exhibitor Information’,
);

if ( isset( $strings[$original] ) ) {

$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}

add_filter( ‘gettext’, ‘mycustom_filter_gettext’, 10, 3 );

} /* End $tkt_slctr_event_id check */

But it doesn’t. If I purposely set $tkt_slctr_event_id to always be 254 by changing:
$tkt_slctr_event_id=$_POST[‘tkt-slctr-event-id’];
to
$tkt_slctr_event_id=”254″;

Then it works, and of course it works no matter what the event ID. Or if instead I add a print “TEST:”.$_POST[‘tkt-slctr-event-id’];
that also works and I can see 254 is the value (albeit this causes premature headers), and it correctly shows another value if I use one of my other events ticket selectors. But for some damn reason I can’t get the function and add filter to load when including it inside:

$tkt_slctr_event_id=$_POST[‘tkt-slctr-event-id’];
if ($tkt_slctr_event_id==”254″) {

}

Really weird. I’ve tried changing
if ($tkt_slctr_event_id==”254″) {
to:
if ($tkt_slctr_event_id==254) {
no quotes around 254. I’ve also tried just simplifying the line to:
if ($_POST[‘tkt-slctr-event-id’]==254) {


Dean

September 17, 2014 at 2:55 am

Hi,

As far as I can tell, $_POST is NULL at that point so that’s probably why it’s not working.

In fact I tried a variety of ways to get the event id but none worked. IF you are on the event registration form, you are off the event and instead on a page (EVENT_CHECKOUT).

As such I don’t think it’s possible to do what you are trying to do at such a specific level.

Viewing 5 reply threads

The support post ‘Suggested feature: ability to change the term "Tickets" and "Attendees"’ 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