Support

Home Forums Event Espresso Premium Getting secondary attendees from registration checkout fields

Getting secondary attendees from registration checkout fields

Posted: December 8, 2016 at 2:11 am


modernearth

December 8, 2016 at 2:11 am

I am trying to access the secondary attendees to a registration. Right now I am using this hook:

https://github.com/ds-festival/event_espresso_4_custom/blob/master/espresso_custom.php

and it works perfectly for what we want for the primary user.. But now I need to know how to loop through all the additional attendees and withdraw their data from it.

  • This topic was modified 7 years, 4 months ago by  Tony. Reason: link format


Tony

  • Support Staff

December 8, 2016 at 7:10 am

Hi there,

We don’t provide support for custom code, however we can help point you in the right direction.

You have the EE_Transaction object which links all of the registrations together so you can use something like kint debugger around the transaction object to find all of the available methods available on the transaction:

d($transaction);

You’ll find the EE_Transaction object has the registrations() method that returns all of the registrations assigned to the transaction. You can then loop over them all and do whatever you prefer.


modernearth

December 9, 2016 at 11:33 am

Hi Tony

I have used the $Transaction->registrations(); to get the object but I am still confused on how to access the secondary registrants emails. I am trying to send out a secondary email on top of the one already sent out so I need to be able to get the email addresses from all the registrants and not just the primary one.


Tony

  • Support Staff

December 9, 2016 at 11:39 am

I have used the $Transaction->registrations(); to get the object but I am still confused on how to access the secondary registrants emails.

Check what registrations() returns, if you have multiple registrations o a transaction it should return an array of EE_Registration objects so not an object, but multiple objects.

You then loop over those to pull the details you need for each registration.

The support post ‘Getting secondary attendees from registration checkout fields’ 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