hide events that are booked in listing

WordPress Event Management, Calendars & Registration Forums General Question hide events that are booked in listing

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10568

    with the shortcode http://wp-event-organiser.com/documentation/shortcodes/event-list-shortcode/ [eo_events] I can show all my future events. But i don’t want to show the events that are fully booked ( Cap booking)

    Is it possible to hide them?

    thanks

    http://www.bijlouise.nl

    Marnix Bras
    #10577

    Hi Marnix,

    The easiest way to hide them is to edit the event list shortcode/widget template file (http://docs.wp-event-organiser.com/theme-integration/how-do-i-customise-the-templates/) with the following (just after the while loop):

     <?php while( $eo_event_loop->have_posts() ): $eo_event_loop->the_post(); ?>
    
           <?php
           global $post;
           $event_id = $post->ID;
           $occurrence_id = $post->occurrence_id; //If selling by date
           $remaining = eo_get_remaining_tickets_count( $event_id, $occurrence_id );
    
           if( !$remaining ){
                 continue;
            }
           ?>
           ...

    This however presents obvious problems if you want to show some definiate number of available (bookable) events. There is currently no shortcode attribute available to exclude events that are fully booked. (I’ll be looking into this – but doing can be complicated, particularly when selling tickets by date. I think a meta data ‘flag’ may be the best way of achieving this).

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 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.