Support

Home Forums Event Espresso Premium Account creation when registrating to an event EE4

Account creation when registrating to an event EE4

Posted: May 16, 2017 at 4:11 pm

Viewing 5 reply threads


JacquesMivi

May 16, 2017 at 4:11 pm

Hello,

We have the ability in EE4 to set a specific page for the account creation when we force users to be logged in to be able to register to an event.

Please see screenshots of the settings I talk about in EE4 backend [screen 1]: https://drive.google.com/open?id=0B4-hsazMWUExX0VaSE9lLXpBODQ

Here is the screen that appears when in front-end I click on register to the event although I’m not logged in [screen 2]: https://drive.google.com/open?id=0B4-hsazMWUExODdQQUoyVmdJakk

Then, I click on “register for an account here” and I register through the page I set up in the EE4 settings shown before.

Once I’m connected, I was excpected to be directed to the page that allow me to go on my registration to the event. The step 2 of the event registration, this one [screen 3]: https://drive.google.com/open?id=0B4-hsazMWUExSXc4RlpUT3ZBa0k

This is the page on which I’m redirected when I directly login when EE4 offer me to do so on the [screen 2]: https://drive.google.com/open?id=0B4-hsazMWUExODdQQUoyVmdJakk

But it is not the case, I stay on the login page, logged in. Do you know how I could do to redirect my users to the step of the event registration once connected through the page I setup in the backend settings “Registration page URL (if different from default Worpress Registration)?

Thanks a lot


Tony

  • Support Staff

May 17, 2017 at 8:50 am

Hi there,

I’m guessing based on the page name you showed in your screenshot that you are using the BuddyPress registration form on that page?

Basically, EE has nothing to do with the registration of the user, it simply provides an option for you to change the default link when the user clicks that they are taken to the page. That page is not a part of Event Espresso so how would it know to redirect back to the event checkout after registration?

Your BuddyPress registration page needs to redirect back to /registration-checkout/ after the user has been registered which should then continue with the registration.

You’ll need some custom development for that and will also need some way to determine if the user came from an EE registration or another part of the site (you don’t want to redirect a user to the EE checkout if they aren’t registering from the checkout page).

If you are using BuddyPress take a look into the bp_core_signup_user hook.

https://buddypress.org/support/topic/how-to-redirect-after-registration/

To be clear, most of what you are trying to do here is outside the scope of EE support.


JacquesMivi

May 17, 2017 at 9:04 am

Hi Tony,
Thanks for the answer. Yes, I’m using BuddyPress registration form here. I understand that it is not within the scope of EE support and I thank you for having helped me with the links you sent me. Do you have any idea of the EE4 code part I should call to in order to store the information / determine that my user is coming from an EE registration?
Thanks a lot


Josh

  • Support Staff

May 17, 2017 at 1:39 pm

You could use the wp_get_referer() function to find out where the user is coming from.

https://developer.wordpress.org/reference/functions/wp_get_referer/


Tony

  • Support Staff

May 17, 2017 at 1:56 pm

There are lots of different options for what you’re trying to do.

The way I would do it would be to use:

$checkout = EE_Registry::instance()->SSN->checkout();

To see if the current user had an EE checkout session, you do this by checking $checkout is an instanceof EE_Checkout.

Then id they did, log the newly created user into the site and redirect them back to the registration checkout page.

The instance of EE_Checkout will have all of the details you need to direct the user back to their cart session.


Tony

  • Support Staff

May 17, 2017 at 2:08 pm

I put together a working example of the above here:

https://gist.github.com/Pebblo/8e657cffab1ddd1bd16451fe567c02eb

Note this should be considered untested (I’ve done some minimal testing to confirm it does what I was expected but it needs much more) and unsupported but it’s a base for you to work on 🙂

Viewing 5 reply threads

The support post ‘Account creation when registrating to an event EE4’ 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