Support

Home Forums Event Espresso Premium New user purchase course first time.

New user purchase course first time.

Posted: February 12, 2019 at 2:20 am


C9

February 12, 2019 at 2:20 am

If a new user comes the first time to purchase an event and get registered at the time of booking event. After successfully payment that purchased event/course is not listed in backend under “All Registrations for this user
” and in the frontend “COURSE DATES”. But if the user again purchased course this time after successful payment both registration are listed, the previous one and the current purchased. The issue is occurring on the first time for non-existing user.


Tony

  • Support Staff

February 13, 2019 at 10:18 am

Hi there,

I tested this on a couple of my test sites and the initial registration shows up on the accounts for those sites. Checking through the code of the WP User integration add-on it specifically checks if it has created a new user and links the users to the EE contact for the registration.

Something I did notice on your site, is the link to register for an account (THIS) is using a checkout session. I looks like you’ve customized the new user registration process to try and use EE’s registration form, however, whatever you are doing to force EE past the user check it likely what is breaking your ‘first’ registration as it will be linked to whatever the ‘current’ user is during that first registration?


C9

February 14, 2019 at 11:22 pm

Hello Tony,

Thanks for your reply.
What I am trying to do is at time of registration I have to call curl and hit third-party API need to insert some data using API and in response want to save some data in the usermeta table as well. So how can I achieve that or which hook I can use without breaking the internal process? Also when a user comes and purchases event for the second time at that time also I want to call third-party API using curl.

Can you please suggest a specific solution to achieve this?

Thanks,


Tony

  • Support Staff

February 15, 2019 at 2:30 am

Can you please suggest a specific solution to achieve this?

At what point in the registration do you want to make the call?

For example, what if someone registers onto the event but does not actually pay? Do you still want to make the call?

You’ll need to be specific on when you want to make the additional call as it will affect the hook you can use to do so.

In either case, this seems to be a different issue than the above?


C9

February 19, 2019 at 7:38 am

If the user registered and did not purchase any event at that time also I want to hit API and insert data to the third party, In case of purchasing event I will use a PUT request to update event against the same user. And after successful payment only I want to update event data to third-party API. So I am need of two hooks first is at successful registration and one at successful payment.

Apart from these one more I found is that at time of the successful registration user is not receiving an e-mail with account info only receiving payment/event detail emails.


Tony

  • Support Staff

February 21, 2019 at 7:22 am

Before going into 3rd party requests on specific actions, wouldn’t it be best to fix the above issue first? Right now your first registration isn’t linked to your WP user account because of how the site is set up.

Adding additional requests based on that current behaviour and then changing that behaviour will likely mean the below is no longer valid.

If the user registered and did not purchase any event at that time also I want to hit API and insert data to the third party

The problem with that is you are using EE as the main WP User registration on your site, for example, the link to register a new user on your site links to an EE checkout form, that’s not expected and not how the WP User integration was intended to be used.

When the WP user integration add-on creates a user it fires this action:

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_created

When it updates a user it first this action:

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_updated

You can hook into those to make a request, but again, I have no idea if that will work as expected due to your setup, it’s not standard.

In case of purchasing event I will use a PUT request to update event against the same user.

You can use the same hook the WP User integration add-on uses to do its processing (you need the same data right?)

AHEE__EE_Single_Page_Checkout__process_attendee_information__end

Take a look in \eea-user-intergration\EED_WP_Users_SPCO.module.php for example of how you can pull the information you need.

So I am need of two hooks first is at successful registration and one at successful payment.

With regards to the latter, after payment, do you want the hook to first with ANY payment made on a registration or only when the registration is updated to be ‘Approved’? (Meaning the registration was paid in full or the admin manually set the status to Approved)

Apart from these one more I found is that at time of the successful registration user is not receiving an e-mail with account info only receiving payment/event detail emails.

Its still not clear if the WP User integration is actually adding the WP User or something else, the emails in question are generated by WordPress itself, EE creates a user using wp_create_user() which automatically triggers a new user notification email from WordPress.

Have you confirm they are not going to spam?

The support post ‘New user purchase course first time.’ 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