Check bookings from admin events page

WordPress Event Management, Calendars & Registration Forums General Question Check bookings from admin events page

This topic contains 4 replies, has 3 voices, and was last updated by  Stephen Harris 7 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25573

    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
    #25575

    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
    #25576

    Hi Stephen,

    The admin calendar will do the trick I believe.

    Thanks for your response!

    Alex

    Alex Hofstra
    #27173

    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
    #27221

    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
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.