After last update the counter is not working.

WordPress Event Management, Calendars & Registration Forums General Question After last update the counter is not working.

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

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

    Hello Stephen,

    After the last update to 1.10.2 I have run into a problem.
    I had been using this this block of code on the single-event.php. to display a message.

    +++++++++++++++++++++++++++++++

    <?php
    $remaining = eo_get_remaining_tickets_count(get_the_ID());
    if( $remaining == 0 ){
    printf( ‘

    Deze %d lesdatum is volgeboekt. Je mag een andere datum kiezen.

    ‘ );
    }elseif( $remaining > 1 && $remaining < 4 ){
    printf( ‘

    Er zijn nog %d toegangsbewijzen beschikbaar!

    ‘, $remaining );
    }elseif( $remaining == 1 ){
    printf( ‘

    Er is nog %d toegangsbewijs beschikbaar!

    ‘, $remaining );
    }else{
    echo ‘ ‘;
    }
    ?>

    +++++++++++++++++++++++++++++++

    It has stopped working. I assume I need to update this line of code: $remaining = eo_get_remaining_tickets_count(get_the_ID())

    Please can you tell me what I should now use to get this working again.

    Many thanks.

    Regards,
    Tony

    Tony
    #16895

    Hi Stephen,

    I forgot to mention “$remaining” is getting a value of “0” when there are plenty of tickets still for sale.

    Regards,
    Tony

    Tony
    #16901

    Hi Tony,

    I think this is a bug when that function isn’t passed an occurrence ID. I’ll look into this and release a patch as soon as possible.

    Are you selling by ‘series’ or by ‘date’?

    Additionally, if the plug-in was working for you in 1.10.1, I’d suggest reverting to that version as the last update was only a minor bug-fix update.

    Stephen Harris
    #16902

    Hi Stephen,

    We are selling by date currently.

    Thanks for looking into this.

    Kind regards,
    Tony

    Tony
    #16967

    I’m posting an update for everyone else’s benefit.

    When selling tickets by date, the eo_get_remaining_tickets() function requires and occurrence ID as well as an event ID. Examples of how it is used in these two contexts (selling tickets ‘by series’ and ‘by date’) can be found here: codex.wp-event-organiser.com/function-eo_get_remaining_tickets_count.html

    There will be an update shortly which would allow you not to specify an occurrence ID when selling by date IF the event has only one occurrence. However, for multi-occurrence events, this would give misleading results (i.e. it would give the remaining tickets for one particular occurrence).

    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.