Support

Home Forums Event Espresso Premium Extraction of a user registered events

Extraction of a user registered events

Posted: April 1, 2019 at 10:01 pm


KLLASC

April 1, 2019 at 10:01 pm

Hi,
We intend to build a
personalized
page which lists the events a user has signed up for as well as his tickets.

How can we extract the event details as well as the ticket and QR code?

Thanks.


Tony

  • Support Staff

April 2, 2019 at 4:36 am

Hi there,

We’ll need more details to help provide any useful info here.

For example, what object(s) do you have currently?
What context are you working in?

Have you been using the WP User integration add-on to link the user account to the user registrations?

If you basically want your own custom version of the My Events table from the WP User integration add-on you could just load your own custom versions of the templates to change that output but ‘personalized’ above doesn’t really give us enough of an idea of which direction your are heading.


KLLASC

April 2, 2019 at 5:07 am

Thanks Tony for your response.

We have created 2 events, the first 4-day event has a ticket containing a QR quote for us to record the user’s attendance via the EE Mobile App.

The second event has radio-button question listing 8 topics for the user to select which he wants to attend and a Reason text field should he choose not to attend.

The “personalized” page is meant to conveniently show information pertaining to the logged in user, such as
1) His ticket for the first event, ideally showing the QR code;

2) The topic and Reason, if any, that the user has previously registered via the second event.

Hope this clarifies.

Thanks.


Tony

  • Support Staff

April 2, 2019 at 7:12 am

Have you been using the WP User integration add-on to link the user account to the user registrations?

The above sounds very specific for your use case and isn’t something we examples available for, we can show you how to pull specific registration questions using the EE_Registration object models but I don’t think you have the registrations yet, correct?

The QR code is generated by the browser within the message system, generating that on the page itself will require you load the JS library used by the ticketing add-on and a fair bit of custom development. Again we don’t have any examples of doing this as it’s not something EE supports at this time.

The “personalized” page is meant to conveniently show information pertaining to the logged in user, such as
1) His ticket for the first event, ideally showing the QR code;

2) The topic and Reason, if any, that the user has previously registered via the second event.

Those a registration specific rather than event based, so you’ll need the registrations for the user and if you’ve been using the above add-on to link registrations to the WP user account you can pull them in, but if not how are you planning on pulling the registrations?


KLLASC

April 3, 2019 at 7:42 am

Hi Tony,
Yes, we have WP User integration in place and already have actual registrations captured and associated with the logged-in user profile.

Is there any documentation for the EE_Registration object model?

If embedding the QR within our page is challenging, is it feasible to construct the URL pointing to the logged-in user’s ticket (like that embedded in the registration email notification)?


Tony

  • Support Staff

April 4, 2019 at 5:33 am

Yes, we have WP User integration in place and already have actual registrations captured and associated with the logged-in user profile.

The way registrations work with EE is they generate an EE_Contact and link the registrations made to that contact (it will also check for an exisitng contact that matches the registration details passed before generating a new one and if one is found it links to that contact rather than a new one). The WP User intergration assigns the User account to the EE_Contact, not the registrations themsevles.

What that mean is to pull the registrations for a specific user, you need the EE_Contact (Attendee) assigned to that WP User profile, you can do that using:

if( class_exists( 'EED_WP_Users_SPCO' ) ) {
	global $current_user;
	$attendee = EED_WP_Users_SPCO::get_attendee_for_user( $current_user );
}

If there is an attendee linked to the current user, $attendee will be an instance of EE_Attendee.

From there you can do:

$registrations = $attendee->get_registrations();

To pull all of the registrations from that attendee.

Now you’ll have an array of EE_Registration objects to do whatever you with to do with them.

I’d recommend taking a look over how the WP User integration add-on pulls the details it needs as it’ll show you most of what you need.

Is there any documentation for the EE_Registration object model?

Theres developer documentation on the model system here:

https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System

Although we don’t have documentation specifically for each model.

If embedding the QR within our page is challenging, is it feasible to construct the URL pointing to the logged-in user’s ticket (like that embedded in the registration email notification)?

Yes and that’s relatively simple to do once you have the registration object, I have an example of adding a ‘Download your tickets’ link to the thank you page which shows what you need here:

https://gist.github.com/Pebblo/525890c30baa7e207e4f

The support post ‘Extraction of a user registered events’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 months, 2 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!