Posted: December 11, 2017 at 4:53 am
|
Hello, Please is there a way (or a filter/action) that can enable me redirect a non-logged in user on EE4 register page trying to register for an event that requires login to a different (Central) login page on my website and after successful login, redirect the user back to the registration page (maybe using the redirect_to URL parameter) instead of using the default register form (in register page) provided by event espresso? |
Hi there, With the EE4 user integration add-on you”ll find the option ‘Registration Page URL (if different from default WordPress Registration)’ that you can set in: Event Espresso -> Registration from -> User Integration Settings If you set the URL you want to use for registrations there EE will direct the user to that, is that what you are looking for? As for the redirect back, you’ll need to hook into whatever page you using for the custom registration and use a hook there. For example here’s how you redirect to the checkout page after using BuddyPress for site registrations: https://gist.github.com/Pebblo/8e657cffab1ddd1bd16451fe567c02eb What are you using for the custom registration page? |
|
|
Hello Tony, No, that’s not what I’m looking for. I referring to the login form (Step 1) of event registration. I want my existing users to login in a separate page (already created) and then redirected back to the registration process form. |
You can redirect logged out users using something like: https://gist.github.com/Pebblo/4c7521a7bde86f013d5f96b5f1de6adf You may want to add some additional checking to that function to confirm the user is not logged in, however, the login step is currently only initialized if they are not. The redirect back will depend on what you are using for your custom page, rather than using redirect_to as part of the query string, I would check if the user currently has an active cart session and redirect back to the cart if so, you’ll find an example of doing that in the first link I gave you above but will likely need to change the hook used for whatever login page you are using. |
|
|
Thanks Tony, Just what i was looking for. I will implement the code example. Please how do i check if the current(now logged-in user) has an active EE4 cart? Is there a function, filter or action hook that i can call to return a TRUE or FALSE to that? |
No, but the other function I gave you shows you how to check if you have an active checkout in your session: https://gist.github.com/Pebblo/8e657cffab1ddd1bd16451fe567c02eb#file-example-php-L6 If you are currently in a checkout session that will return and instanceof, otherwise null, so:
Run that within the function you are using to return the user. |
|
|
Hello Tony, Works like a charm! Here’s what i did:
Solved my issue. Thanks! |
You’re most welcome. |
|
The support post ‘EE4 Event Registration Redirect Users to Separate Login Page’ 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.