Support

Home Forums Event Espresso Premium More informations in the attendee list

More informations in the attendee list

Posted: August 26, 2015 at 12:39 pm


Merlin

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


Tony

  • Support Staff

August 26, 2015 at 1:24 pm

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


Merlin

August 26, 2015 at 2:01 pm

thanks but i have some problems with that.

i’ve tried this:

<li><?php echo $gravatar . '&nbsp;' . $contact->full_name() . '&nbsp;' . '-' . '&nbsp;' . $ticket . '&nbsp;' . '(' . $datetime . ')'; ?></li>

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


Josh

  • Support Staff

August 27, 2015 at 9:10 am

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:

http://developer.eventespresso.com/docs/using-ee4-model-objects/#Getting_fields8217_values_from_model_objects_in_various_formats


Merlin

August 28, 2015 at 4:12 am

hey josh,

sorry but i didn’t get it.

some questions:
do i have just editing the content-espresso_event_attendees.php or the loop too?

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


Tony

  • Support Staff

August 28, 2015 at 6:59 am

Hi Merlin,

This error:

Fatal error: Call to a member function pretty_price() on a non-object.

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.


Merlin

August 28, 2015 at 7:58 am

thank for your effort!!


Tony

  • Support Staff

September 1, 2015 at 3:28 am

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:

http://developer.eventespresso.com/docs/model-querying/


Josh

  • Support Staff

January 21, 2016 at 10:02 am

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.


Merlin

February 4, 2016 at 6:44 am

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


Josh

  • Support Staff

February 4, 2016 at 7:22 am

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.

Event Espresso