Events Made Easy › Forums › How do I … › Showing the bookings per event
Tagged: bookings event list
- This topic has 2 replies, 2 voices, and was last updated 10 years, 7 months ago by Franky.
-
AuthorPosts
-
Wed 9 Apr 2014 at 16:38 #44226AnonymousInactive
Hi,
my client wants to hold events in a non-recurring manner. So the way I see it is: when she wants to create a new instance of a previously created event, she simply duplicates the event and we’re good to go.
However she also wants users to give a rating to an event (understand here: not the instance of the event, but THE event), and also put comments, and have a list of all future occurrences of that event.
Now I can partially resolve this by using categories. So I create a “Balloon Party” category, and all events created in the “Balloon Party” category can be listed. And I create a classic wordpress page called “Balloon Party” that uses some eme placeholders, allows for comments and ratings and all that good jazz.
But what my client also wants is to see, for each future occurrence of the event, how many places have been booked and how many places are left.
And that’s where I don’t know what to do. I guess I could use eme_bookings but how do I know which event_id to put in parameter? I guess I could probably solve this with templates, but I don’t see how.
Wed 9 Apr 2014 at 21:11 #51499FrankyKeymasterIn this case I guess it’s best to work with your own theme’s function.php.
Create a function that returns the future occurrences of the event, based on the event ID:
$my_event=eme_get_event($event_id);
$extra_conditions="recurrence_id=".$my_event['recurrence_id'];
$future_events=eme_get_events(....., $extra_conditions);(see eme_events.php for the function eme_get_events)
and then loop through these events and return the free/total seats:
foreach ($future_events as $future_event) {
$my_id=$future_event['event_id'];
print eme_get_available_seats($my_id);
print eme_get_booked_seats($my_id);
print $future_event['event_seats'];
}Wed 9 Apr 2014 at 21:22 #51500FrankyKeymasterOr, maybe simpler: create a second cat for your recurrence (like a hidden category, just for that recurrence) and use the following placeholder in your single event format:
[eme_events category=MY_CAT_ID template=MY_TEMPLATE_ID]
replacing MY_CAT_ID with the ID of the category you just created and assigned to the recurrence, and replace MY_TEMPLATE_ID with a template just showing the free, total and/or booked seats for that event, e.g.:
Booked: #_RESERVEDSPACES
Avail: #_AVAILABLESPACES
Total: #_TOTALSPACES
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.