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


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?

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.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 weeks, 4 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[i]
[i]