Support

Home Forums Event Espresso Premium Short Code to Display Registration Totals

Short Code to Display Registration Totals

Posted: March 13, 2017 at 5:09 pm

Viewing 5 reply threads


David Traxler

March 13, 2017 at 5:09 pm

Is there a shortcode or a quick way to display registration totals by event?

I’m aware of [ESPRESSO_EVENT_ATTENDEES] but that prints out a list of registrations, e.g. John Smith & Jane Doe – I would prefer to return the value as “2” rather than a list of names.

Thanks!


Josh

  • Support Staff

March 13, 2017 at 6:08 pm

Hi David,

There isn’t a short code, but depending on where you want that total displayed, and whether you want the number to display total registrations that have an approved status (or all registrations regardless of status) there’s probably a quick way to add that via a hook. Do you want that information to be displayed on the single event page somewhere?


David Traxler

March 14, 2017 at 10:48 am

Hi Josh,

In EE3 I had a standalone page that my instructors for each event could all login to(password protected page), to view the attendance level for upcoming events.

I am hoping to present the totals in a table similar to the table on this page: http://sciencediscoverycamp.com/register-online/

But rather than a register “+” to show the total for each event.

Thanks.


Tony

  • Support Staff

March 17, 2017 at 10:15 am

So you want only the Approved registrations for the event at any given time?

if so there’s no shortcode for that but you could use the get_number_of_tickets_sold() method on the EE_Event object.

That loops over any datetimes within the event and returns the total value of all sold values from those datetimes, is that what you are looking for?


David Traxler

March 17, 2017 at 12:26 pm

That would perfect, any guides on implementation or pointing me in the right direction?


Tony

  • Support Staff

March 20, 2017 at 7:32 am

We don’t have documentation on this kind of customization.

It depends on how exactly your pulling in the events for the table, but if each section is a single event and you have the EE_Event object you can just use:

echo $event->get_number_of_tickets_sold();

If you are using the same loop you have used for the above table you should already have the event object, correct?

Viewing 5 reply threads

The support post ‘Short Code to Display Registration Totals’ 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