I know the WP User Integration is still being done – but I need to have an ‘See all events I’ve signed up for’ kinda page. It is not unsimilar to having a page on a E-Commerce website to See all MY orders.
Since I have to do this, I’m thinking I’ll just contribute the code to you guys later on for WP User Integration
I only want to list all events that the user has signed up for – and then put a little icon for the user to click to link to the payment page if they have not paid.
Can I receive some directions from a developer on which files/functions I should look at?
I looked at EE_Transaction class and it didn’t seem to be quite what I was looking for.
I won’t add the full conversation, but here is the pertinent bit:
Hmm..ok, so I tried to start rewriting the function for the recipient edit registration link but its more complex than I thought it would be. To get me started is there a way to pull the registrations for a particular user ID?
Sure! Keep in mind that the data relationships are setup so that one contact may be related to many registrations, and one user is related to one contact.
With that said, the attendee ID is saved on wp_user_meta via the EE_Attendee_ID key. So you can get all the registrations attached to your known user id by doing something like this:
$user_id = get_current_user_id();
$att_id = get_user_meta( $user_id, 'EE_Attendee_ID', true );
//get the attached contact (EE_Attendee)
$contact = EEM_Attendee::instance()->get_one_by_ID( $att_id );
//now we can use that to get all the related registrations (an array of EE_Registrations objects)
$registrations = $contact->get_registrations();
//now you can loop through those EE_Registrations and setup the data you need.
foreach( $registrations as $registration ) {
echo $registration->event()->name();
//link to edit attendee information
echo '<a href="' . $registration->edit_attendee_information_url() . '">Edit your registration details</a>';
}
If I understand the developer right, this would be used in a custom function or custom shortcode or similar.
$contact is still a EEM_Attendee object, and not a EE_Attendee one. $contact->get_registrations() simply fails to compute since those are different classes.
Is there something I am missing here?
By the way, am I correct to say that Contact Cards are governed by attendee ID? Does the WP User Registration plugin right now not log additional attendees into the correct contact card or to the correct attendee ID?
Now I’ll be honest and say that I’m not 100% sure it will matter, but it seems to work fine with the above.
Viewing 7 reply threads
The support post ‘[EE4] How to get list of events user sign up for’ 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.