The calculation is not correct. I have 20 tickets available and its adding them up incorrectly and saying only 18 ๐ Any ideas. I did just move 2 people from the wait list to pending, would that affect the total?
this is the code I have ` <?php
//* Please do NOT include the opening php tag, except of course if you’re starting with a blank file
add_action( ‘AHEE__ticket_selector_chart__template__after_ticket_selector’, ‘ee_print_number_of_tickets’, 10, 2 );
function ee_print_number_of_tickets( $EVT_ID, $event ) {
if ( $event instanceof EE_Event ) {
if ( ! $event->is_sold_out() && $event->is_upcoming() ) {
//get total approved registrations count
$spots_taken = EEM_Registration::instance()->count(array(
array(
‘EVT_ID’ => $EVT_ID,
‘STS_ID’ => EEM_Registration::status_id_approved,
),
), ‘REG_ID’, true);
$html = ‘<div class=”total-tickets”><h6>’;
$html .= $spots_taken;
$html .= ‘ sold of ‘;
$html .= $event->total_available_spaces();
$html .= ‘ total available</h6></div>’;
echo $html;
}
}
}
Looking at your event the count appears to be correct?
For me it shows ’18 sold of 20 available’, unless this isn’t from one of the 2 public events on your site?
Viewing 3 reply threads
The support post ‘16 sold of 18 total available’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.