Hi Stephan,
I have a question, we plan workshops/trainings and there are several 30+ to check or schedule.
Is the a possibility to check the bookings for an event from the events admin page? I mean is there a button tot show the bookings?
Now we have to search within the booking admin page for a particular event to see the bookings
I hope my question is clear
Alex
Alex Hofstra
Hi Alex,
No there isn’t. This is partly because it would add a lot to the page – and is complicated by the fact that that events can have multiple dates, and bookings for individual dates.
What would be reasonably straightforward to do however, would be add to a link on the event admin page to the bookings page, pre-filtered to events by that date. I could provide some code to that if that would be helpful.
In fact, another way to view bookings for a particular event (event date if selling by date) is via the admin calendar. Simply find the event, and click it, they’ll be a bookings tab. From there you can follow the link to the bookings admin screen – again pre-filtered by the event.
Stephen Harris
Hi Stephen,
The admin calendar will do the trick I believe.
Thanks for your response!
Alex
Alex Hofstra
Hi Stephen,
I’d be interested in the code for this: would it be possible to do it on the ‘All events’ list? I think it would be doable to include for one-off events something like ‘Booked 10 of 30″ in small type below the event name. For recurring events, a link as you suggest that perfilters the event would be helpful.
Many thanks
Dave
David McCourt
Hi Dave,
Here’s a snippet that will do that :
<?php
add_filter( 'manage_edit-event_columns', function( $columns ) {
$columns['_tickets'] = 'Tickets';
return $columns;
}, 20 );
add_action( 'manage_event_posts_custom_column', function( $column, $series_id ) {
global $post;
if ( '_tickets' !== $column ) {
return;
}
$attending = eventorganiser_get_bookings( array( 'fields'=>'count_attending', 'event_id' => $post->ID) );
$available = eventorganiser_get_capacity( $post->ID );
printf(
'<a href="%s">%s</a>',
eventorganiser_bookings_admin_url( $post->ID ),
"Booked {$attending} of {$available}"
);
}, 10, 2 );
For recurring the events the “Booked X of Y” is across all occurrences.
Stephen Harris