Posted: August 5, 2019 at 9:42 pm
|
I have the user integration add in. I am creating an event where multiple attendees are required, the caveat is, each attendee must be an existing wordpress user. When using an existing email for additional attendees though, an error is returned and I cannot proceed to payment options. As a test, this still happened even if I disable ‘Auto create users on registration’. Is there a way to sync additional attendee data to existing users (just like it does for the primary attendee?) Also, Is it possible to replace the additional attendee information with a simple dropdown, whereby the user simply selects from a list of existing registered users, and the registration becomes synced to teh user? What files/hooks/functions should I look to in order to begin this grueling endeavor? Thanks! |
You can disable the check used for that using the one of the functions here: https://gist.github.com/joshfeck/1131145859a3fab58f4d You likely need the one from disable_email_match_everyone.php
Syncing changes to the wp user account? No, because then essentially any user could update any other users details by simply adding them as an additional registrant.
Not currently. |
|
|
Thanks Tony. What do you make of this makeshift way to superficially sync additional attendee information with existing wp users?: i) disable email check In the grand scheme of things, the additional attendees should be existing users in wordpress so that I can track statistics on each attendees performance over time. Would hacking together relationships in MySQL an acceptable way to do this? |
I’m not really sure I can answer that question. If I understand what you want to do correctly then you’re allowing a single user the ability to update other users details of your site using based on knowing their email address, personally, I don’t think that’s a good idea. The only person that should be able to update your details is yourself, linking a registration to another user’s EE contact is fine, you’re not updating anything so worst case if you have additional registration attached to your EE_Contact that you were unaware of. Users changing other users details brings that to a whole other level in my opinion. Without knowing all of the details I’m assuming you’ll have no way to track this, so if someone figures out that they can do that and decieds to just randomly update user accounts with random data, your going to have a real mess to fix. |
|
|
Hi Tony, Initially, I had not considered that the registrant would be able to change another attendees data. I agree that this has the potential for an explosive disaster that I am no longer interested in tempting. Now I only want a safe way to track a registrant registering other wp users as additional attendees. If I am understanding correctly, linking additional attendee emails to a matching UserID in mysql is a non risky way to do this? THanks in advance. |
Again if I understand correctly, that sounds fine in terms of risk. However, I’m not sure it will solve the problem. What exactly are you trying to track? You mention searching for wp_users based on email and then linking them to a matching User ID, which User ID? The ID of the user making the registrations or the ‘found’ user? What is the end goal you are trying to achieve? |
|
|
Currently, I have events where individual attendees register. Then on the day of the event, competitions are held and I can record the performance statistics of each attendee, because the attendee IDs are tied back to their WP user account id. Their WP user account IDs have stats associated with them. Now I am trying to run team based events, and I would like to use a similar model, where attendees can be tied back to existing WP user IDs (registrant ID to registrant WP ID, additional attendee ID to their existing wp userIDs) so their team based statistics can tie back to their individual WP user statistics also. But as mentioned, the duplicate email issue came into play. Rather than somehow letting the “registrant” update the additional attendees’ details, the only way I can think of to sync additional attendees to their WP IDs is to ensure the “registrant” enters emails that corresponds to existing WP user emails. Do you feel this is the optimal way, given EE constraints? |
So you’re linking all registrations to their WP_User accounts similar to how the WP USer integration add-on links the primary registrant to their account? Has every member registered onto an event at least once? When you register onto an event with EE it creates an EE_Contact using the First Name, Last Name and Email address of the registrant (It will ONLY do that is you are using the System Questions, meaning you need to ask the ‘Personal Information’ question group on additional attendees). Before creating new contacts it searches for any current contacts (not WP Users, EE contacts) that match the First Name, Last Name and Email address of the registrant, if it finds one it links the registration to that contact. The WP User Integration add-on integrates EE_Contacts to WP_User accounts by saving the WP_User account ID as a meta value of the EE_Contact. There’s a fair bit more to it than the above, but if you go through how the add-on does what it’s doing you may be able to alter the functionality to do what you need working from that which in the long run may work better than what you’re trying to do. The add-on currently only sets the EE_Contact -> WP_User relationship for the primary registrant but again its something you could alter to work with others. I don’t think relying solely on the email address is a good idea, you should use First Name, Last Name and Email. Note that the reason I asked if every member has already registered onto an event is that if that’s the case, they will already have an EE_Contact. If you had the WP User integration add-on enabled when they registered their contact will be linked to their User account already…. remember how EE checks for contacts before creating new ones? Well if they already have an EE_Contact that matches and that contact is already linked to a WP User, they only thing you need to do is make sure that when the ‘Group leader’ adds them as a registration, they user the system questions to do so and the details entered match the other WP users details exactly.
Which EE constraints? There’s nothing within EE stopping you from doing what you want to do but you’re going to need custom code to do it. |
|
|
Hi Tony, The process flow you described for the creation of EE_Contact is extremely informative. The documentation for this add_on doesn’t seem to explain details like this, where can I go to obtain specific details on EE backend process flow?
This is really interesting.. does this mean if the Primary Registrant enters a set of First Name, Last Name, Email that matches that of an existing wp user(as an additional attendee), then it will reference an existing EE_Contact, which is already linked to a WP User(provided the attendee created an account with the add-on enabled)?? I think my work could be done already! To allow this to work (linking additional attendees ->EE_contact-> wp_users), I would only need to use the ‘disable email check’ function? And some validation to match attendee Names + Email to WP user names + email(?). |
Creating an EE_Contact is actually nothing to do with the add-on, its how Event Espresso core works, EE_Registrations are linked to EE_Contacts even without the add-on, the add-on basically uses that relationship to then link the EE_Contact with a user. What it means is if the user has added multiple registrations all using the same details, then they will all be linked to the same contact, once the EE_Contact is linked to the WP_User, all of the registrations linked to the contact are now related to the WP_User. The add-on forms the latter relationship, it does not have anything else to do with EE_Contacts. We don’t have documentation walking you through the above information, you would need to follow the code.
You didn’t answer my question, so I don’t know. If the WP_User has already registered themselves onto an event, they will have an EE_Contact using the details they input during the registration. If another primary registrant inputs those details into an additional registration, that registration will be liked to the EE_Contact (again I should point out, that details must have matched exactly). So if they already had a contact linked to a WP_User, then yes, that registration is now linked to the user.
What is the validation for? If you want to confirm that the additional registrants are always also WP_User, you can, but you’d also need to halt the registration if not to prevent additional EE_Contacts from being created when no match is found. There are examples of doing that (halting the registration process) in the WP User integration add-on, for example with the email check your disabling. |
|
|
Sir, It appears to have worked. Entering the exact same details for additional attendees as an existing wp user appears to result in the wp user’s ATT_ID being applied to the additional attendee (who is the same person). The validation would be to confirm that additional registrants are also existing wp_users. Do you know if such a function exists already for this? If not, can you direct me to the file containing the relevant fields/functions that handles additional attendees? I will attempt to hook in and add in some kind of ‘existing_wp_user’ validation. Thanks! |
Great 🙂
The WP user integration add-on does exactly that. Take a look at the
We don’t provide support for customizations, so I can’t walk you through how to do that (yes, that includes how to use EE’s own built-in functions) but if you follow the code above you should see how it works. A hint, it uses get_user_by(). |
|
The support post ‘Event Registration – registering existing wordpress users as additional attendee’ 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.