A potential client previously had a requirement to add a feature to his film festival website developed using Event Espresso. The feature involved providing the event website admin with a feature to add multiple venues to a single event.
Let’s approach the requirement with an use case.
So let us assume an ‘Event X’ will be held at two different locations. Currently, Event Espresso provides users with a feature to add multiple dates to an event. However, there isn’t any option to add multiple venues to a single event. So the question is how can the requirement be fulfilled?
A crude solution to incorporate this feature would be to create separate events for each location. While this functionality works perfectly well and serves the purpose, it can lead to certain hiccups at a later point of time. For instance if the web admin wants a consolidated list of all users registered to an event irrespective of the location then it will have to be done manually by viewing the event page for each location in the dashboard. This process can become increasingly time consuming and tedious with every additional location that is added to an event. That’s when the need for a customization arises.
Our primary goal here would be to allow event espresso users to add multiple venues to a single event.
Once this has been done there will also be a need to capture the multiple venue data into the database and render it to the front end as and when required by the end user.
1. Add Venue Dropdown for Event Datetime Field
- Event Espresso provides an option to specify ‘Event Datetimes’ on the event page in the dashboard.
- We will need to add a dropdown menu in this section that will list all event venues. The admin will use this drop down menu to select a venue for any given date and time.
2. Map Datetime with Venue
- The event datetime and venue that will be provided by the admin using the interface provided in step one will need to be saved in the database. A separate table should be created in the database for this purpose.
- Now the event datetime will be mapped with the event venue and saved in the newly created table.
3. Display Multiple Venues to End User
- Up until now we have dealt with the dashboard and we have dealt with the database. The next step would be to display the multiple venues associated with an event on the front end.
- A new template will have to be created which will be used to display the the multiple venues. The event espresso template to display events will be overridden by the newly created template either in the child theme or in a plugin.
4. Customize Email Sent to Registered User
- At present Event Espresso provides a feature to send confirmation emails to a user who registers to an event. The email contains event details such as event name, event datetime and event location.
- This template will now have to be customized to include the appropriate event venue details in the email that is sent to the registered user.
5. Synchronize Event Details with Calendar
- In an occation that the Event Calendar plugin is being used by the event management website, the multiple venues of an event will also have to be incorporated into the event calendar. In order to achieve this the event calendar plugin will have to be customized.
Including this solution can make event management extremely easy for websites that host events in multiple locations as creation and consolidation of events and its data becomes simple. Also, it makes the process of event search and event registration simple for the end user as he now has access to event data in a single page on the website.
You may also like to Read: Search Events by User Location in Event Espresso
Images by freepik