Support

Home Forums Event Espresso Premium Purchasing a ticket for another user

Purchasing a ticket for another user

Posted: February 14, 2022 at 12:48 pm

Viewing 5 reply threads


pathwise

February 14, 2022 at 12:48 pm

Problem:
When a user purchases a ticket on behalf of another user, that in turn creates the user’s account for which the ticket was purchased.

Now the same anonymous us, wants to purchase another ticket for that same user. However, this time since the other user already has an account, they get an error along the lines of existing user, please log-in

So it seems that once a user has been created by the system, it will no longer allow any more tickets to be purchased by an outside party on their behalf.

Expected Behaviour: I would like to have it so that if a user purchases a ticket on behalf of someone else with the same email address as an existing user, that that ticket be assigned to that user and transaction is allowed to proceed.

Please note, we are also using this following snippet to create user accounts for all registrations via signup:
https://gist.github.com/cvanderlinden/fa8cd18498ef7cfa84be03d484b32a80


Tony

  • Support Staff

February 15, 2022 at 6:34 am

Hi there,

You’ll need to disable the email_user_match_check within the WP User integration add-on for this, you can do that with the snippet here:

https://gist.github.com/joshfeck/1131145859a3fab58f4d#file-disable_email_match_everyone-php

Note that it’s the second file in that gist which is just a single line:


add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', '__return_false' );

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


pathwise

February 15, 2022 at 10:28 am

Thanks Tony.

Does this have any other implications? What exactly is that filter doing?


Tony

  • Support Staff

February 15, 2022 at 1:56 pm

In short, it just removes the check for an existing user.

If you are using the above option it would also likely be a good idea to DISABLE the WP contact sync function:

Event Espresso -> Registration Form -> User Integration Settings -> Always sync contact information with WP user profile?

Make sure that is set to no, as with the above you could force the WP User account to sync with a new invalid account.

Other than that I can’t think of any other implications for this.


pathwise

February 15, 2022 at 2:35 pm

Thanks, I have added that filter

add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', '__return_false' );

I set Always sync contact information with WP user profile? to No.

As a note I also have Default setting for User Creation on Registration. set to Yes.

The expected functionality I am looking for is now this:

1. When someone registers for an event, it will all attendees and create associated accounts for them.
2. When someone registers a user for an event and that email address (user) already exists, that registration will be added to that user as well.

Example:

I am the main account holder, and I register.
Attendee 1: me@example.com
Attendee 2: them@example.com

That will create an account for me@example.com and them@example.com
Then I try to register for another event:
Attendee 1: me@example.com
Attendee 2: them@example.com

That will add the registration to me@example.com and them@example.com both the user accounts that already exist. Is this correct?


Tony

  • Support Staff

February 15, 2022 at 3:12 pm

It should be yes, but you’re using custom code that isn’t what EE would do by default, so I can’t give you a 100% yes or no here.

Viewing 5 reply threads

The support post ‘Purchasing a ticket for another user’ 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