Support

Home Forums Event Espresso Premium Register multiple attendees and WP users for all

Register multiple attendees and WP users for all

Posted: February 23, 2023 at 9:37 am

Viewing 5 reply threads


Justin

February 23, 2023 at 9:37 am

Hello,

We sell tickets to conferences for educators and have been running into an issue with accepting multiple registrations. How it works is a single user, such as a principal or org leader will need to register multiple people for the event. They are the only person authorized to use the payment in this case. In order to ensure only paid users can access the event we also need a WP user created for each registrant. We have installed the WP user integration and it works fine when a single user registers. However, if multiple users are registered at the same time it currently only creates a WP user for those who do NOT currently have a WP user. Because these are annual events many users already have a WP user. If they already have a WP login then it EE does NOT add the new user registration to their account.

Is there a way that I can have it either create a new WP user OR link the new registration and ticket info to their existing WP user?


Tony

  • Support Staff

February 24, 2023 at 4:21 am

Hi there,

However, if multiple users are registered at the same time it currently only creates a WP user for those who do NOT currently have a WP user.

Not to sound nitpicky, but is this correct? The add-on should only create a WP User account for someone who does not already have a user account, otherwise, there would be 2 user accounts for one person, right?

Currently, the add-on will only create a WP User account for the Primary Registrant (the first set of details entered) and not all registrants. So I assume you want to create an account for each individual registrant added?

Because these are annual events many users already have a WP user. If they already have a WP login then it EE does NOT add the new user registration to their account.

Hmm, so the issue isn’t regarding the WP User accounts but the relationship between the WP users and their registrations?


Justin

February 24, 2023 at 10:05 am

You are correct. My initial post could have been worded more clearly. The WP users are created as expected (I do not want duplicate users), the issue is that the new registrations are not added to the existing WP users accounts. Is it possible to Both create a new user if one doesn’t exist and update existing WP user accounts with the new registration if an account already exists?


Tony

  • Support Staff

February 27, 2023 at 2:42 pm

Hmm for me that happens already.

So let’s step back here and confirm what is happening.

If 5 registrants are created on your site, does it currently only create a WP User account for the primary registrant?

(The default behaviour for the add-on is to create a WP user account for the primary registrant only, but we have a snippet which creates a user account for each registrant if they don’t already have one, are you already using that?)


Justin

February 28, 2023 at 1:52 pm

We had an event last week where someone registered themselves and 3 other people. The person who registered logged in and the event was synced to their account. Of the other 3, 2 of them already had an account. The one without an account had it created and it worked fine. The other 2 were registered but the event was not added to their WP user, so when they logged in they could not view it.

I believe you are referring to this script: https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-wp-user/jf_ee_process_multi_wpuser_for_attendees.php

Yes, I have that set up as a WP plugin. Does it need to be a “must use” plugin?

It does say at the top of that script the following: ” * Q: What happens if there is already a user account matching the email address for one of the registrations?
* A: By default, it will not allow the registration to proceed and they will be prompted to use a different email address or log in.”

In the end I had to manually add a database entry to link the registration with their WP user. Luckily there were only a few.

Thanks!


Tony

  • Support Staff

February 28, 2023 at 2:27 pm

I believe you are referring to this script

Correct, I am.

Yes, I have that set up as a WP plugin. Does it need to be a “must use” plugin?

Nope, a standard plugin is just fine.

It does say at the top of that script the following: ” * Q: What happens if there is already a user account matching the email address for one of the registrations?
* A: By default, it will not allow the registration to proceed and they will be prompted to use a different email address or log in.”

Yeah so this is all part of what is a bigger picture here.

That comment is referring to the fact that the WP user integration add-on was intended to give a list of YOUR registrations and not really a list of registrations other have also made for you. It can work that way with specific conditions out of the box, but its not how it was originally intended to be used.

So there is a ‘user match check’ within the add-on which uses the email address to check for a current WP user account and prompts you to log in if it finds one… but thats also filtered so it can be disabled.

The fact that you can continue the registration means you like have one of these snippets in place to disable that check:

https://gist.github.com/joshfeck/1131145859a3fab58f4d

—-

Now… onto your issue.

The code in the above snippet, creates a WP user account if it doesn’t find one for the user. It does that HERE.

It sets the $user_created variable to true when it does this… HERE

It then assigned the EE_Attendee_ID as user meta to the newly created user account a little below HERE.

All of that…. is working fine, because otherwise this:

The one without an account had it created and it worked fine.

Would not happen.

What sounds like is ‘failing’ is the last condition within that snippet, THIS.

Did the registration info input for those 2 people who already have account match exactly?

The first name, last name and email, all matched exactly?

Viewing 5 reply threads

The support post ‘Register multiple attendees and WP users for all’ 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