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
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
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
Hi Stephen,
We are selling by date currently.
Thanks for looking into this.
Kind regards,
Tony

Tony
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