Posted: August 26, 2015 at 12:39 pm
|
hello, is there a way to show more informations in the attendee list witch i show with the shortcode [ESPRESSO_EVENT_ATTENDEES]? For example the Name and the chosen ticket or datetime? thanks |
Hi Merlin, Take a look within /event-espresso-core-reg/public/ You’ll find the loop-espresso_event_attendees.php & content-espresso_event_attendees.php Those templates are used to build the output for that shortcode, you can copy them to /wp-content/uploads/espresso/ and make edits there. For example copy content-espresso_event_attendees.php to /wp-content/uploads/espresso/ and modify the template there. You’ll find the $contacts, $event, $datetime and $ticket objects available within loop-espresso_event_attendees.php |
|
|
thanks but i have some problems with that. i’ve tried this:
but it only shows “- ()”. how i have to call the ticket object? do i have to modify the loop-espresso_event_attendees.php too? thanks |
Hi Merlin, It turns out you take the $ticket and $datetime model objects and get specific fields to print the ticket information instead of echoing out the whole object out. If you do a $print_r on them it will list out the available methods you can run on them as well. You can follow the developer documentation that shows how to get field values from model objects for more information: |
|
|
hey josh, sorry but i didn’t get it. some questions: i found this side http://code.eventespresso.com/class-EE_Ticket.html and i’ve tried $ticket->pretty_price( ) and much more. it gets me a Fatal error: Call to a member function pretty_price() on a non-object. i don’t know what this means. can you give me a sample line of code or the code and the location where i have to add it. i just want to display the full_name, the booked ticket_name and the registration_date in the attendees list. thanks a lot, merlin |
Hi Merlin, This error:
Means you are tyring to call a method (another name for a function), which in this case pretty_price() on ‘something’ that is not an object. So in your example: $ticket->pretty_price(); $ticket->pretty_price(); Means run the pretty_price() method within the object that is within $ticket. And the error is saying $ticket is not an object, so PHP doesn’t know what to do. I did a little more digging into the [ESPRESSO_EVENT_ATTENDEES] shortcode and I’ve found why this isn’t working. The reason is that the shortcode is designed to output the ‘contacts’ from within an event. The problem with that in this case is that the contact does not store the ticket or datetime, the registration does, but a contact can have multiple registration from a single event, or multiple events. This means you need to pull in the registrations for a contact within the specified event making sure you only pull the registrations with the status you want (likely Approved) then display the tickets linked with those registrations. This also means that a single contact could show the same ticket X amount times for a group registration. The ticket and datetime objects I mentioned previously are only valid when you are pulling in the contacts for a ticket or datetime and also need to be passed to the content-espresso_event_attendees.php template, so apologies for leading you along the wrong path. I’ll get some feedback from the team and see if there is a different way to pull this information. |
|
|
thank for your effort!! |
Hi Merlin, I checked into this and currently the objects that are needed needed to pull in extra information from the registration are not passed to the template. You can pull the information in yourself from the contact but as your working with the contact your get all the registrations they have made onto an event, then loop through those and output the ticket name. It would be better to do this through a custom query within your own page template rather than the shortcode, however you would likely need the help of a developer with this. The registration can be retrieved using our models, details are available here: |
|
Update: There is now a quick start guide that shows how you can add answers to custom question fields to the attendee list in our documentation. |
|
|
hello Josh, that’s nice! Thanks for the update! is there a way to show the ticket the user has booked? i’m not sure but i think there is a problem, when a user booked two ore more tickets, right? thanks in advance merlin |
You’d have to loop through each ticket in that case. |
|
The support post ‘More informations in the attendee list’ 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.