Total registration and spaces/tickets remaining on the event

WordPress Event Management, Calendars & Registration Forums Request A Feature Total registration and spaces/tickets remaining on the event

This topic contains 1 reply, has 2 voices, and was last updated by  Dario 10 years, 6 months ago.

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

    I’d like the option of having the total number of tickets/spaces available along with how many are left on the event, so that people can see if they need to sign up soon.

    For example:

    5 out of 15 spaces remaining.
    or
    10 out of 15 tickets sold

    or something?

    I get emails ALL THE TIME from people saying, “How many spots do you have left?” so it would cut down on admin time.

    AlphaSmith
    #8001

    WP EO Pro already has this functionality.

    See these codex pages :
    http://codex.wp-event-organiser.com/function-eo_get_event_capacity.html
    http://codex.wp-event-organiser.com/function-eo_get_remaining_tickets_count.html

    Below is an example of the code that may work for your situation:

    $remaining = eo_get_remaining_tickets_count( get_the_ID() );
    $capacity = eo_get_event_capacity( get_the_ID() );
    if( $remaining > ($capacity/2) ){
            printf( '%d out of %d tickets sold.', $capacity-$remaining, $remaining );
    }elseif( $remaining > ($capacity/4) ){
            printf( 'Hurry, only %d tickets remaining', $remaining );
    }elseif( $remaining == 1 ){
         echo 'Only one ticket remaining!';
    }else{
         echo 'Sorry, there are not tickets available';
    }
    Dario
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.