Support

Home Forums Event Espresso Premium Show Number of Attendees in EE4 Table Template

Show Number of Attendees in EE4 Table Template

Posted: January 31, 2015 at 3:47 pm

Viewing 9 reply threads


hartwig123

January 31, 2015 at 3:47 pm

Hi,
We need to display the number of attendees vs. total seat count within our custom table template. It appears there was a simple shortcode parameter for this in EE3, but it doesn’t appear to have made its way into EE4 Table Template add on yet. Can you please show a code example for getting the attendee count and the total seats available to display them as e.g. “12/100” (# of attendees/total seats) for an event?

Having researched this a lot, the closest thing I’ve found is located here: https://eventespresso.com/wiki/useful-php-code-snippets, snippet section: “Print an attendee list after the content on the event details page”, which shows a SQL query doing some join to get the attendee names etc. We really just need a head count and the total available seats. Please let me know if you require any additional information for this.

Thanks!


Dean

February 2, 2015 at 3:54 am

Hi,

The way EE4 is coded means that something like this is much more complex: are you using one datetime or more? one or more tickets? are the limits set for datetimes or tickets or both?

If you can, please provide an example of how you have the event/s set up and I can speak to a developer about how best to go about it.


hartwig123

February 4, 2015 at 2:21 pm

Hi, Dale.
The events will be a single datetime and require a single “ticket” (registration) for entry. We’ll just need to pull how many registered attendees there are and how many remaining seats there are based on that. Thanks!


hartwig123

February 4, 2015 at 2:22 pm

Sorry: Dean! Not sure why I typed Dale there! Thanks!


Dean

February 5, 2015 at 6:55 am

Hi,

It’s fine, I’ve been called a lot worse 🙂

Let me run this by a dev and I’ll get back to you.


hartwig123

February 5, 2015 at 2:44 pm

Okay, I’ll check back on this.

Thanks


Dean

February 6, 2015 at 6:22 am

Hi,

Basically this has been put up for discussion internally as there is nothing like what you want in EE4, and the creation of a one size fits all plugin is daunting due to the flexibility built into the plugin.

So I can’t offer you a fully fleshed out way of doing this, but I have drawn something up that should work within your use case.

Ok, so the following is a code snippet that would go directly into the loop of a custom template. The snippet will only list out the events data, so it would need to be modified to list it out with the table itself, which isn’t that hard really.

Note that the max seats is based on the Datetime limit.

https://gist.github.com/Apina/6ca2a7fd5ff319d7d10c

Screenshot of dev site: http://take.ms/EbPe2


hartwig123

February 6, 2015 at 11:53 am

Alright. We’ll work this into our custom template and let you know how it goes. Thanks so much for following through on this.


hartwig123

February 6, 2015 at 12:20 pm

Works Great! Here’s a screenshot of it in action:
http://screencast.com/t/0yjWqvMe
Thank you!!!!


Lorenzo Orlando Caum

  • Support Staff

February 6, 2015 at 1:05 pm

Glad to hear you got this working. If you need help with anything else, just open a new support post:

https://eventespresso.com/support/forums/


Lorenzo

Viewing 9 reply threads

The support post ‘Show Number of Attendees in EE4 Table Template’ 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