Support

Home Forums Event Espresso Premium Using hook, how do I get all the attendees info?

Using hook, how do I get all the attendees info?

Posted: August 2, 2016 at 2:44 pm

Viewing 6 reply threads


Ryan Short

August 2, 2016 at 2:44 pm

I’m using ‘AHEE__EE_Registration_Processor__trigger_registration_update_notifications’ and can currently only get the main attendee’s info. $registration->attendee()->email(); for instance. How do I get the email address, for instance, of attendee 2,3, etc.?


Josh

  • Support Staff

August 3, 2016 at 8:58 am

You should be able to get all of the registrations that belong to the same transaction by using the transaction() method that’s available with that $registration object.


Ryan Short

August 5, 2016 at 1:19 pm

Is there a place online that I can see whats available inside the $registration object?


Josh

  • Support Staff

August 5, 2016 at 1:37 pm

What’s available can depend on the context. What you can do is install the kint debugger plugin and put this in your code:

d($registration);

Which will output all kinds of useful information including available methods.


Ryan Short

August 8, 2016 at 9:44 am

I’ve installed the kint debugger but not sure where to look to see the var_dump info, etc. Can you send screenshots with your reply?


Ryan Short

August 8, 2016 at 11:04 am

Actually I’ve worked thru all this, but how do i get all the events a user has ever signed up for by user ID?


Josh

  • Support Staff

August 8, 2016 at 3:31 pm

One way is you get the Contact ID from the user metadata like this:

$att_id = get_user_option( 'EE_Attendee_ID', get_current_user_id() );

Then you can build a query for events in a similar way that the WP User Integration add-on does where it makes a list of all registrations for the current user profile page. You can find some working example code in /EED_WP_Users_Admin.module.php, in the view_registrations_for_contact() method.

Viewing 6 reply threads

The support post ‘Using hook, how do I get all the attendees 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