Posted: August 4, 2014 at 12:04 pm
|
What is the name of the file that generates the information on the event registration page? I have been searching through php files, looking for code that is tied to the event_espresso_form_wrapper class. I would like to change the alert for a specific event without changing the alerts for the other events. I am attempting to hide the date that is included in the alert. I already tried removing the date from the event itself, but now the alert says “You have registered for event name on .” I would like to change it to “You have registered for event name.” while keeping the original for all other events. |
|
Hi James, Which version of EE are you referring to? Which alert (or perhaps message?) are you referring to as I cannot trace that text in either plugin? I’d be happy to help you resolve this, I just need to clarify exactly what it is you are trying to change. Thanks. |
|
Hi Dean, We are using EE 3.1.35.2. A colleague showed me the file that has a hard coded message in it. The file is registration_page_display.php located in \wp-content\plugins\event-espresso\templates. What I am now trying to do is create an if statement that will check the category of an event. If the category matches certain criteria then the code will print out a message that does not include the date of the class. Otherwise, it will continue to print the current code: I would like to make the category a variable, but I am unsure which table from the mysql database to call to get that information. Basically, I would like to create a variable that contains the value of the event’s category then compare that variable to something else and print out a message based on the result of the comparison. In short; How do I get the category of an event into registration_page_display.php? |
|
Hi James, I’ll be honest and say I’m still not sure what you are trying to achieve, nor can I trace that message. However, answering your question is easy enough. In the registration_page_display.php an object is used called $event. You can get the category ID’s associated with the event by using $event->category_id This will return a comma separated string of ID’s, so you will likely need to explode it and then run through a foreach. Doing a var_dump() on $event will show you what data is available to play with. |
|
Dean, I apologize for my ambiguity, but you have still pointed me in the right direction! I will try this and get back to you. Thanks! |
|
No problem! It’s not your fault, sometimes it’s hard to figure things out just by swapping forum posts, but we do our best! |
|
Hi Dean, Thank you again for all your help. I tried $event->category_id and doing a var_dump($events) but I would receive NULL. I even tried to use the CATEGORY_NAME shortcode, which allowed me to get the name of the category, but it did not work if an event had multiple categories. After further research, we found the topic. This checked for the event’s category and I combined it with an if statement. Here is my working code.
|
|
This was the solution that was used. |
The support post ‘Changing an event registration alert to hide the date for a specific event’ 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.