Support

Home Forums Event Espresso Premium 16 sold of 18 total available

16 sold of 18 total available

Posted: October 31, 2018 at 5:48 pm

Viewing 3 reply threads


Jonathan

October 31, 2018 at 5:48 pm

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;
}
}
}

?>`


Tony

  • Support Staff

November 1, 2018 at 6:18 am

Hi there,

Can you add a screenshot of your ticket and datetime sections within the event editor?

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots


Jonathan

November 1, 2018 at 10:43 am

here you go: http://nimb.ws/E738ns


Tony

  • Support Staff

November 1, 2018 at 11:18 am

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.

Event Espresso