Support

Home Forums Event Espresso Premium Modify content-espresso_event_attendees.php to show specific info

Modify content-espresso_event_attendees.php to show specific info

Posted: November 15, 2019 at 7:32 am

Viewing 1 reply thread


engineroomweb

November 15, 2019 at 7:32 am

Hi guys,

I have been trying to modify the content-espresso_event_attendees.php file to show the following for each registrant with an approved ticket and wondering if you are able to help.

Would, if possible, like to show the following for each registration:

– Event Date/Time Purchased
– Registrant Full Name
– Custom Question Content – ID 14

Needs to be ordered by “Event Date/Time” Purchased if possible.

It is so that we can see all registrations for a specific event to see Father Christmas in the right order with the specific information on the children.

Any help would be amazing.


Tony

  • Support Staff

November 18, 2019 at 10:10 am

Hi there,

So the ESPRESSO_EVENT_ATTENDEES shortcode pulls all of the EE_Contacts linked to the registrations for an event, but some of the details you need are from the registrations and you can’t always accurately pull the correct registration from the contact object alone.

You can think of the EE_Contacts as the actual people attending the event.

A person can create a registration (or multiple registrations) on an event and EE creates an EE_Registration object for each of those and then links that registration to the EE_Contact.

You can think of the registration as the object that links everything together for an event (the closest physical thing I can think of is an actual ticket for an event), it shows the contacts name but also holds all of the details specific to that registration (questions, the options they selected, the datetime the ticket was set to etc).

So it’s easy to ask a person for their full name etc but if a single person has multiple registrations on an event and you want registration X, it’s difficult to know which registration that is, if all you have is a name (EE_Contact), make sense?

What you can do is use the get_most_recent_registration_for_event() method, which as the name suggests gets the ‘last’ registration for the event made by a contact. Depending on your event set up that may not work for you so before going any further is the last registration on a contact usable for you?

As an example:

$latest_registration = $contact->get_most_recent_registration_for_event($event->ID());

Would give you the last EE_Registration object in $latest_registration

If that’s not going to work for you you’ll likely need something custom to pull all of the EE_Registrations on an event and then list the details for the registrations (which includes EE_Contact data, but you have the actual registrations made then).

Is this for front end users to view or staff?

Viewing 1 reply thread

The support post ‘Modify content-espresso_event_attendees.php to show specific info’ 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