Posted: April 5, 2016 at 1:22 pm
|
I have an event for a high school reunion. We are selling tickets for 2 different nights. We will have people sign up who are possibly bringing a spouse on either night. People are finding it confusing when signing up for the first night they are “Attendee 1 & 2” and on the second night are “Attendee 3 & 4”. Is there a way to make the attendee number reset for the second night signup (since they will be the same people), or simply prevent the number from showing on the page? I have looked through the forum and cannot find an answer. Thanks. |
Hi Julie, You can’t easily reset the number, however you can change it not to show a number at all. Would you prefer just ‘Attendee’ or another phrase? |
|
|
Okay, that works. How about just removing the number and leaving it “attendee”? |
Sure. The easiest way to do that is by translating the string to remove the number. We have an example of a function you can use to do that here: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function The string to translate would be ‘Attendee %d’, the %d is a place holder for the number. So we can just translate the string to not use it, 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( 'Attendee %d' => 'Attendee', // 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 ); You can add that function to you child themes functions.php file or create a Site Specific Plugin and place it within that. Does that help? |
|
|
I tried this using a plugin for functions, but it says there is an error. I don’t know about the syntax for functions. Do I need to add something before and/or after this code? |
Can you copy all of the code from your plugin and paste it on either http://pastebin.com/ or create a gist here so I can view the code please? |
|
|
Sorry, this is too complicated for me. I’ll just keep it the way it was originally written. |
I’ve wrapped my example up into a plugin you can install if that helps? You can download it here – http://take.ms/b8o1A When you have the .zip file go to Dashboard -> Plugins -> Add New -> Upload plugin. Select the .zip you downloaded from the above, upload and activate. I’ve ran this through some quick testing on a live test site and found no problems. |
|
|
You are too kind. You all really go above and beyond to take care of people. Thank you so much. It works like a charm! |
You’re most welcome, Julie. Any further problems just let us know 🙂 |
|
The support post ‘Attendee Number – can I reset it or hide it while registering’ 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.