Support

Home Forums Event Espresso Premium Show Number of Attendees for an Event

Show Number of Attendees for an Event

Posted: May 1, 2017 at 9:15 pm


Theresa Stanton

May 1, 2017 at 9:15 pm

I recently upgraded to EE4 and have a couple things I want to add to an events list and single event page that I had success adding in an older EE version.
1) I need the Event details to show how many attendees are signed up vs. how many total are allowed. It would show up like this: “3 of 15 attendees total”.

2) I need to do a global change of the word “Event” to “Class” and “Sold Out” to “Class full”. I’ve tried using the custom function but it does nothing, even when I’m being specific in the string.

Another thing that has been happening is that the system is allowing people to sign up for the class even though the sign-up total has been reached and they have not completed payment yet. I need it to show that the class is full because some attendees will be paying by check in person and not by Paypal.

Here is the site that I’m implementing EE4 in: http://playtimediscoveries.com/summer-camp-registration/


Theresa Stanton

May 1, 2017 at 9:28 pm

To give you an example of what I’m looking for, this person had also requested it a while back: https://eventespresso.com/topic/number-of-attendees-and-spots-left-not-displaying/
I had customized the event_list_display.php file in that version and it worked great.

But then in this post it says that the shortcode no longer exists for EE4? https://eventespresso.com/topic/event_attendee_number-number-of-attendees-for-ee4/
Why would you remove this shortcode in the updated version? I would really like it back because my client is asking for it. I’m pretty annoyed since I recommended she pay for the upgrade but it’s not working like it did before.


Josh

  • Support Staff

May 2, 2017 at 9:05 am

Hi Theresa,

There wasn’t actually any removing of shortcodes from EE4, what happened is the shortcodes built for Event Espresso 3 were never intended to be used for Event Espresso 4.

Here’s some code you can add to your site to get what you’re looking for in question 1:

https://gist.github.com/joshfeck/d4ddcd2f2d25732d7a666123ab99a4e5

With regards to:

2) I need to do a global change of the word “Event” to “Class” and “Sold Out” to “Class full”. I’ve tried using the custom function but it does nothing, even when I’m being specific in the string.

The custom function will translate specific strings, and there are multiple strings that include “event” in their text. Can you post the code that you tried into a pastebin or gist so we can take a look?

With regards to:

Another thing that has been happening is that the system is allowing people to sign up for the class even though the sign-up total has been reached and they have not completed payment yet. I need it to show that the class is full because some attendees will be paying by check in person and not by Paypal.

It sounds like you’ll need to set the Default Registration Status to Approved in the event editor. This way, if someone selects “pay by Check” at checkout, their spot will be reserved after they finalize registration. When the Default Registration Status is “Pending Payment”, that means only registrations that have paid count toward the registration limit.


faeger

May 3, 2017 at 7:23 am

Hi Josh

Thanks for the custom function – is there a way to also pull “not confirmed”-tickets into the count?

Thanks
Philip


faeger

May 3, 2017 at 7:45 am

… and if possible – can you tweek the code to only show the count once per event. As we have multiple datetimes for the same event (and only that), we don’t want the count to be displayed below every datetime.

Thanks Josh!
Cheers
Philip


Josh

  • Support Staff

May 4, 2017 at 3:15 pm

Hi Philip,

You can make use of the second code snippet from the example:

https://gist.github.com/joshfeck/d4ddcd2f2d25732d7a666123ab99a4e5#file-my_event_registration_count-php


faeger

May 4, 2017 at 6:08 pm

Thanks Josh – didn’t see/realized that.

But the second code snippet does count the cancelled registrations as well… this is confusing as with this snippet it sometimes shows “22 of 18 tickets sold”.

Is there a workaround?

Cheers
Philip


Theresa Stanton

May 5, 2017 at 11:40 am

Ok, I got the registration count to work; thank you!
As for the text string replacement, sometimes it works and sometimes it doesn’t. Here’s the code: https://gist.github.com/theresavs/614829a9c2d80bd95e6688f6eb675d51#file-filter_gettext-php

The last string isn’t being replaced. You can see it here: http://playtimediscoveries.com/classes/summer-camp-2017-week-1-lego-construction-ages-5-10/


Josh

  • Support Staff

May 5, 2017 at 12:02 pm

Hi Philip,

I updated the code so it will remove any cancelled registrations from the count.


Theresa Stanton

May 5, 2017 at 12:09 pm

I just tried adding a string to replace “Sold Out” with “Class full” and it’s not changing it. Here’s the page it should be showing up in: http://playtimediscoveries.com/classes/summer-camp-2017-week-2-harry-potter-camp-ages-6-11/


Theresa Stanton

May 5, 2017 at 12:11 pm

Ok, never mind about that last one, I discovered I had to add a   between “Sold” and “Out”.


Theresa Stanton

May 5, 2017 at 12:12 pm

Ugh, it’s supposed to say  

  • This reply was modified 6 years, 11 months ago by  Josh. Reason: Fixed it for you


Theresa Stanton

May 5, 2017 at 12:13 pm

Updated the code file to show what I mean since it’s not showing up here. Sorry about the confusion.


faeger

May 5, 2017 at 2:10 pm

Thanks Josh for the update!

It’s really fun working with EE4 – and, or course, with you guys!

Have a great weekend!
Cheers
Philip


Tony

  • Support Staff

May 8, 2017 at 4:00 am

@theresas

When translating strings you need to input the full string for the original string you are translating, the last string you have in your example is only half of the string, it should be:

The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$shttp://take.ms/Qzwi7

So to change the text you are trying to, you’ll need:

'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s' => 'Date and time this class is scheduled for %1$s%2$sAdmission is always one person per ticket.%3$s'

I’ve added the above as a comment on your gist in case it’s a little easier to read.

The support post ‘Show Number of Attendees for an Event’ 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