Posted: October 2, 2023 at 4:34 am
Hi, I’m looking for a way to customize my attendee list, which is visible on my site. I’ve managed to pull up some custom questions, however I want to list the exact ticket they’ve bought as well as this says something about their class they play in. This is my .php:
|
|
Sorry, forgot to add some text. So I’m looking for a way to display the name of their ticket as well. I’ve read a lot online, it seems like it doesn’t pull this information from contact but probably from registration. I’ve tried $ticket->TKT_name(), $TKT_name and $ticket_name, but none of them seem to be working. |
|
Hi there,
You can think of EE_Contacts entities as ‘people’, an EE_Contact holds the First Name, Last Name, Email (and other details) that identify a person so it may help to think of the EE_Contact as the actual Attendee themselves. EE_Contacts have a one-to-many relationship to EE_Registrations meaning a single person (let’s say me, Tony Warwick) can have multiple registrations assigned to it (because I can register multiple tickets, be it on the same or separate events). That means that what you are trying to do can get a little tricky because not all contacts will always have just one registration related to them, within the code you can always use the ‘latest’ registration for an event, but that design choice for that code (technically thats also what your answer code above is doing as its ordered by ANS_ID, meaning it will pull in the ‘latest’ answer to that question). To pull in the latest registration for a specific event, you can use:
From there you can pull in the related ticket:
And output any details you want relating to the ticket from there, for example, ticket name:
Is that what you are looking for? |
|
The support post ‘Attendee list – Show which ticket they bought’ 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.