Support

Home Forums Event Espresso Premium Show number of people registered on an events page?

Show number of people registered on an events page?

Posted: September 29, 2015 at 11:24 pm

Viewing 27 reply threads


denise

September 29, 2015 at 11:24 pm

I am looking for an easy way for my staff to go to the event and see how many people are registered, either with full registration or incomplete, without them having to log in. Is there anyway I could do this?
Thanks,
Denise


WisdmLabs

September 30, 2015 at 12:37 am

If you are using event espresso 3 then you can simply use existing shortcode

[ATTENDEE_NUMBERS event_id=1 type=num_attendees]

If you are using event espresso 4 then you can paste following code in functions.php file of child theme or create separate plugin

add_shortcode('EVENT_ATTENDEE_NUMBER','fun_display_attendee_number');
function fun_display_attendee_number($atts)
{
  global $wpdb;
  $event_id = $atts['event_id'];
  $registration_table =  $wpdb->prefix.'esp_registration';
  $count = $wpdb->get_var("SELECT COUNT(REG_ID) FROM $registration_table WHERE EVT_ID='$event_id'");
  return 'Number of registrations: '. $count;
}

​And call shortcode as ​[EVENT_ATTENDEE_NUMBER event_id=1]

​You use these shortcodes in description area of event.​


denise

October 6, 2015 at 6:19 pm

Great Thank you!


denise

October 6, 2015 at 8:08 pm

I created the function in a plugin, and setup the short code. Right now when I use the shortcode I only see 0. Is that because I am using each event to create a “recurring” events. For example one event (class) recurs every saturday. When I click on the event on my calendar to see the description I get taken to a page that has all the possible dates for the class. So when I add the shortcode to my description what is getting displayed? All the attendees that ever register?

What if I wanted to show those who have registered but are pending payment?

If I wanted to show the attendees for a specific event/ticket is there a way to do that?

Here is my calendar so you can see what I am doing:

http://miyceramics.com/events/mosaics-beginners/


Josh

  • Support Staff

October 6, 2015 at 10:37 pm

Hi Denise,

The code that the folks from wisdmlabs looks like it’s for displaying the total registrations per event. So when you put the shortcode on the page, you’ll need to put the full shortcode and include the event ID of the event. So for the Mosaic Beginners page you would place [EVENT_ATTENDEE_NUMBER event_id=2723] where you want the number displayed.


denise

October 13, 2015 at 10:34 pm

Hi Josh,

Thanks. Sorry but I can’t seem to figure out where you get the event_id, can you please tell me?

For a class the uses one event, but lists mulitple dates if I use [EVENT_ATTENDEE_NUMBER event_id=2723] and I just getting the list of everyone who has signed up for all the events? What If just wanted the number of attendees for the next session? So that each week it would update the attendee number?


Tony

  • Support Staff

October 14, 2015 at 5:22 am

Hi Denise,

You get the event id from the Events list, go to Event Espresso -> Events.

There you will find a list of events with the ID within one of the columns – http://take.ms/L5x9G

For example to output the attendee for ‘UK Event’ in that screenshot I would use:

[EVENT_ATTENDEE_NUMBER event_id=251]

For a class the uses one event, but lists mulitple dates if I use [EVENT_ATTENDEE_NUMBER event_id=2723] and I just getting the list of everyone who has signed up for all the events? What If just wanted the number of attendees for the next session? So that each week it would update the attendee number?

That’s not how the code WisdmLabs shared works, it pulls the total registrations for the entire event (not the datetime) after you provide the Event ID.

So your wanting this on a single page to pull in the registrations on the next upcoming datetime?


denise

October 15, 2015 at 9:13 am

Hi Tony,

Since the recurring events function isnt ready yet, the easiest way for me to manage an event that happens every week for the whole entire year is to have one event and the times repeated inside that event, so I only have one event page, but almost 52 events dates in it.

I’m looking for an easy way for my instructors to know who is coming to a specific date time. If there’s only six people coming next monday we don’t want to have to set up for 20, and it’s inefficient for them to log into the website every time to see who is registered, especially when they have someone on the phone asking if there’s room for a specific date for them to bring a few friends.

It doesn’t matter to me if its another page or the events page as long as it’s possible just to be really really useful.

Thanks!
Denise


Jonathan Wilson

October 15, 2015 at 11:19 am

Hey Denise,

You can list the attendees for a specific datetime by using this shortcode: [ESPRESSO_EVENT_ATTENDEES datetime_id="datetime_id_for_event"]

From our docs:

The datetime_id_for_event is a numeric ID for your datetime and it can be found by looking at the ID which appears for a datetime when you have clicked the advanced options (gear icon) for a specific datetime in the datetimes editor within the event editor in your WP Dashboard.


denise

October 15, 2015 at 11:42 am

THanks Jonathan.

So from my understanding… every time I add a new event date time I have to go and add the new [ESPRESSO_EVENT_ATTENDEES datetime_id=”datetime_id_for_event”] for that event?

I have about 800 events a year….!!!!! Is there an easier way?


Lorenzo Orlando Caum

  • Support Staff

October 15, 2015 at 3:06 pm

Hi, the ESPRESSO_EVENT_ATTENDEES shortcode has a few different options including showing attendees for a specific ticket (pricing option) or for a specific datetime.

If you are wanting to show attendees from a specific datetime for an event, then you would need to use the datetime_id parameter.

https://eventespresso.com/wiki/ee4-shortcodes-template-variables/#event-attendees

Otherwise, it will show all attendees for a specific event if it is added through the event description area.


Lorenzo


denise

October 15, 2015 at 8:06 pm

Hi Lorenzo,

So what you are saying is that because my events have recurring datetimes (event repeats every week but there is only one unique instance of the event), if I want to show attendees for the next upcoming datetime of that event I have to create a unique instance for each and every datetime, right? So somewhere on my site I have to lookup and create 600 unique datetime shortcodes for my 12 different event types just so that I can publicly show how many people are attending the upcoming class?

Do you know of any other options, this is going to kill me and make it impossible for anyone else to manage the calendar?! I just want to display how many people are signed up for a given class on the next upcoming date?


denise

October 15, 2015 at 8:56 pm

Hi Again,

I reread the link you provided and found this:

List approved attendees for the earliest active event or the earliest upcoming event
[ESPRESSO_EVENT_ATTENDEES]

This does exactly what I am looking for, so please ignore my previous rant :).

No this leads me to another question Currently if someone buys 2 tickets, when this shortcode gets called I only see the one name for the first attendee, I don’t get to see how many people that person might be bringing. How can I get that information?

Thanks!
Denise


Tony

  • Support Staff

October 16, 2015 at 7:43 am

[ESPRESSO_EVENT_ATTENDEES] will pull in the contacts for the event, not the datetime. So if you have multiple datetimes with registrations, all of the contacts across all of those datetimes will be shown.

The above is true when no datetime_id is passed to the shortcode, which you can not do as you need it to dynamically pull the registrations value for each datetime as it becomes the next one.

So you want to be able to do something like this – http://take.ms/D5FPo

Which then parses to – http://take.ms/wYO0A

If so you can do that using this:

https://gist.github.com/Pebblo/8973605280c4c5ac9672

Note that we can not provide support for this, I it a function I have adapted from something similar I had created previously, if you require something more than this you may need to contact a developer.


denise

October 16, 2015 at 11:46 am

Hi Tony,

You you are correct, I found out that [ESPRESSO_EVENT_ATTENDEES] will return ALL attendees for all future events, not just the next upcoming one, which means the doc (https://eventespresso.com/wiki/ee4-shortcodes-template-variables/#event-attendees) is misleading and should read that it returns attendees for all future event datetimes, not just the next one.

Your function works, but it only works for “SOLD” vounchers. I would like to display all like the status= option in the [ESPRESSO_EVENT_ATTENDEES] shortcode. Any chance of that being possible?


Tony

  • Support Staff

October 19, 2015 at 2:27 am

When [ESPRESSO_EVENT_ATTENDEES] is used outside of the EE Event description and is not passed an event ID it will pull in the next upcoming event (not datetime) and show all contacts for that event.

Your looking for a specific datetime within an event, so [ESPRESSO_EVENT_ATTENDEES] is actually working as expected, it shows all contacts registered onto a specific event across all datetimes.

Pulling counts for a specific datetime and for a specfic registration status is currently not something Event Espresso supports by default. Also note that a single datetime can have multiple tickets assigned to it, the count then needs to take into consideration all the registrations across all of those tickets assigned to the datetime.

I’ve created a new shortcodes based on my previous version, this shortcode pulls all of the registrations a assigned to all tickets within the next upcoming datetime of an event.

https://gist.github.com/Pebblo/f89e3a7076acde7e7998

By default it will return the approved registrations, you can change this using ‘status=”all”‘ within the shortcode, for example:

[NEXT_UPCOMING_DATETIME_REG_VALUE status=”all”]

The will still exclude registrations with a status of ‘incomplete’ because they do not apply to the event at all (there are no contact details at all within those registrations)

You can also pass any of individual statuses you can with [ESPRESSO_EVENT_ATTENDEES], such as:

[NEXT_UPCOMING_DATETIME_REG_VALUE status=”RPP”]

Would be a count of Pending Payment registrations.


denise

October 19, 2015 at 12:37 pm

HI Tony,

Thank you so much for your support and patience with me :).

About:
“When [ESPRESSO_EVENT_ATTENDEES] is used outside of the EE Event description and is not passed an event ID it will pull in the next upcoming event (not datetime) and show all contacts for that event.”

This is exactly what I want, I am using it within the event, but it is listing everyone registered for all future events not just the next upcoming one.

You can see it here:
http://miyceramics.com/events/glass-fusing-introduction-2/

Your new Shortcode works great it shows that I have 4 for tonight, you can see it on the same page as above while [ESPRESSO_EVENT_ATTENDEES status=”all”] shows about 14 entries.

**************************
On your new shortcode there is and error on the first line:

functionfunction display_next_upcoming_datetime_reg_value( $attributes = array() )

should be
function display_next_upcoming_datetime_reg_value( $attributes = array() )

*************


Tony

  • Support Staff

October 20, 2015 at 12:57 am

This is exactly what I want, I am using it within the event, but it is listing everyone registered for all future events not just the next upcoming one.

That isn’t what you want, you want the registrants for the next upcoming datetime, not the whole event. Your using the shortcode within an event post, so [ESPRESSO_EVENT_ATTENDEES] is using that Events ID and displaying the registrants for that whole event which is what its intended for.

Currently there isn’t a shortcode that will pull in the next upcoming datetimes attendees.

On your new shortcode there is and error on the first line:

Thanks. That was a pasting error, fixed now.


Tony

  • Support Staff

October 20, 2015 at 10:48 am

I’ve also found an issue when using my shortcode when using the Calendar.

The ajax request prevents the event from being pulled which breaks the shortcode, to fix you’ll need to prevent the shortcode from running within ajax requests.

I’ve updated my Gist to include

//If this is being pulled by the Calendar, get out.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
{
    return;
}

I would recommend adding that to your function.


denise

October 20, 2015 at 11:00 pm

Thanks Tony! I am happy that your shortcode will give me the count for the next DATETIME, that is extremely useful in the “class” calendar scenario.

Sorry it took you so many explanations before it the nuances of datetime and event finally sunk in :).

The feature to have the attendees for a specific datetime would also be useful, is this something I can get a support token for? Or request somehow?

Thanks!
Denise


Tony

  • Support Staff

October 22, 2015 at 2:27 am

Hi Denise,

If you’d like to purchase a support token I can create a shortcode that will pull in the registrations for the next upcoming event. (Note that depending on how many details/options you want this may take more than 1 token)

I’m assuming from your question above that you want to display the name of the primary registrant with a group size, something like:

Tony Warwick
Group Size: 5

Like this – http://take.ms/KKXDB


denise

October 23, 2015 at 3:11 pm

Hi Tony,

Just bought the token thanks. Yes that is what I want, on the event page to display the people registered for the next upcoming event. I also like the the bottom text that breaks down each payment group.

Please let me know what I should do next.

Regards
Denise


Lorenzo Orlando Caum

  • Support Staff

October 23, 2015 at 3:28 pm

Hello Denise, please use this form to activate your support token:

https://eventespresso.com/redeem-a-support-token/

Tony will then follow up with you to confirm what you need for the shortcode customization.


Lorenzo


Tony

  • Support Staff

October 26, 2015 at 9:15 am

Hi Denise,

Just letting you know I’m working on this and will be in touch shortly via your support token.

I also like the the bottom text that breaks down each payment group.

That’s just multiples of [NEXT_UPCOMING_DATETIME_REG_VALUE] from above, here is the content of that event:

The next upcoming event has: [NEXT_UPCOMING_DATETIME_REG_VALUE status=”RPP”] Pending Payment registrations

The next upcoming event has: [NEXT_UPCOMING_DATETIME_REG_VALUE] Approved registrations

The next upcoming event has: [NEXT_UPCOMING_DATETIME_REG_VALUE status=”all”] registrations


denise

October 26, 2015 at 9:26 pm

Hi Tony,

Thanks :). I installed and activated the plugin, but the shortcodes are not running any more. I also unzipped the templates and put the two php files in my child theme. Should I remove the code for NEXT_UPCOMING_DATETIME_REG_VALUE in my “custom” functions plugin?

Thanks!
Denise


Tony

  • Support Staff

October 27, 2015 at 4:09 am

No you don’t need to remove the REG_VALUE shortcodes.

The problem was the shortcodes all had <wbr /> within them, like this – http://take.ms/88MQp

I switched the editor to text mode to see that.

Also I left some debug code in the new shortcode, I’ve removed that from your install, it didn’t prevent the shortcode from working, but it wasn’t needed 🙂

Can you check it over an make sure its working as expected now please?


denise

October 27, 2015 at 11:55 am

YEP! Sorry about that, it was a copy and paste error.


Tony

  • Support Staff

October 28, 2015 at 3:30 am

No problem 🙂 I’ glad its working.

Just let us know if you have any further questions.

Viewing 27 reply threads

The support post ‘Show number of people registered on an events page?’ 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