[Skip to main content](#vessel-content)

#   Login/register redirect

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

8 years 4 months ago [\#295358](#295358) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295358 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

I am looking for advise here.

Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?

As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...

Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....

I assume this somehow could be set during checkout in view files...

Any advise welcome.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 4 months ago [\#295374](#295374) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295374 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hello,

The redirection is handle by Joomla core itself.
If you put an ACL on the menu ; HikaShop is not even called or related to the affair.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[developer](/forum/user/57298-developer "View developer's Profile")**
- [![developer's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57298-developer "View developer's Profile")
- [ Offline](/forum/user/57298-developer)

Less More

- Posts: 6
- Thank you received: 0
-
-

8 years 4 months ago [\#295713](#295713) by [developer](/forum/user/57298-developer "View developer's Profile")  Replied by *[developer](/forum/user/57298-developer "View developer's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295713 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

kyratn,

Did you end up working out a solution for your needs for this issue? If so, what did you do?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

8 years 4 months ago [\#295722](#295722) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295722 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi,

Unfortunately i did not. I am still looking for solution. As for now we are busy with other things but for sure will have to look again for it soon....

As for now the only i could think is to have another login/register page with custom redirections and redirect to that page before checkout. However having 2 login pages for different purpose is kinda odd ![:(](/media/kunena/emoticons/22.png ":(")

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[developer](/forum/user/57298-developer "View developer's Profile")**
- [![developer's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57298-developer "View developer's Profile")
- [ Offline](/forum/user/57298-developer)

Less More

- Posts: 6
- Thank you received: 0
-
-

8 years 4 months ago -  8 years 4 months ago [\#295724](#295724) by [developer](/forum/user/57298-developer "View developer's Profile")  Replied by *[developer](/forum/user/57298-developer "View developer's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295724 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi kyratn,

I managed to get something working for our website.

Basically I turned off the 'Redirect Joomla registration to HikaShop Plugin' and just used the Joomla registration. I created a menu item of type 'User &gt; Registration Form' that loads the register user form, then redirects to the [strike]new users account profile page[/strike] login page upon successful registration.

Last edit: 8 years 4 months ago by [developer](/forum/user/57298-developer "View developer's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

8 years 4 months ago [\#295726](#295726) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295726 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi,

Well as i know it does that by default. What we need is to have one form and somehow set different redirections based on it was a checkout or just simple login registration through site.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[developer](/forum/user/57298-developer "View developer's Profile")**
- [![developer's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57298-developer "View developer's Profile")
- [ Offline](/forum/user/57298-developer)

Less More

- Posts: 6
- Thank you received: 0
-
-

8 years 4 months ago [\#295728](#295728) by [developer](/forum/user/57298-developer "View developer's Profile")  Replied by *[developer](/forum/user/57298-developer "View developer's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295728 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

I'm guessing you would need to add an if/else type block and some redirects in the file '/components/com_hikashop/views/user/tmpl/after_register.php' to do what you want.

I haven't done much Joomla coding since v1.x days so I'm of no help sorry.

I'm glad my problem was an easier fix than yours ![:P](/media/kunena/emoticons/14.png ":P")

Good luck

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14327
-
-

8 years 4 months ago [\#295717](#295717) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295717 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi,

Note that if you try to access a menu item of HikaShop's user control panel, HikaShop will redirect you to the Joomla login form and will tell joomla to redirect you back to the URL you were trying to access before after the login.
And for the checkout, the login process is handled by HikaShop's login form so there is no redirection issue.
As Jerome said however, if you add access levels to your menu items, then it's Joomla handling the redirection to and from the Joomla login form and HikaShop doesn't have any control on that.
And it's the same for other extensions, or login forms.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

8 years 4 months ago [\#295768](#295768) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295768 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi,

Thanks Nicolas for clarification but i think your have misunderstood my question. I will try to describe what i want.

I do have menu with login form. In that form, as for now, in hidden input i have set:
Code:

&lt;?php echo base64_encode($_SERVER['HTTP_REFERER']); ?&gt;

So whenever user login he is redirected back to hes previous page. It works fine!

Now the idea is to have 2 steps checkout.

First step "Cart view" and second step" All other views"

When user is on first step and tries to go to next step he will be redirected to that login form and after succesful login redirected to step 2 ( same would apply to registration form ).

Now, i know how to do everything except how to find if user has come from checkout step 1 OR he just tries to login through some site "Login" button...

I can't redirect to checkout step 2 after every login cause it would make no sense for user. So as for know i see 2 solutions. Create 2 login forms, one for checkout and other for simple site login. Or to find a way to get previous page menu item id, in that way i will be able to set different redirection based on ID after login/registration...

I know it is outside hikashop support so you may replay or not to this, or you can just give some tip as experienced developer here ![:)](/media/kunena/emoticons/3.png ":)")

Kind Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14327
-
-

8 years 4 months ago [\#295838](#295838) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Login/register redirect](/forum/4-how-to/895258-login-register-redirect#295838 "Hi,  I am looking for advise here.  Is there a way to set different redirect returns urls to joomla login form after successful login based on where user came from to that login page?  As example, if user do a checkout he should go back to checkout page. If user just tries to login, he should be redirected as per login menu options or something...  Basically we are looking to have something similar as ebay or asos have. They have one login/register page and if you do a checkout, after login or registration you will be redirected back to checkout and vice versa if just simply trying to login....  I assume this somehow could be set during checkout in view files...  Any advise welcome.  Thanks")*

Hi,

So if I understand correctly, you're not using the HikaShop form of the checkout, because otherwise, you wouldn't have the problem on the checkout since the login form of the checkout ALWAYS redirects back to the checkout as it is supposed to.
So I'll suppose that you're using the Joomla login module. In that case, you want to create a plugin of the group "user" and implement in it the trigger onUserAfterLogin :
[ docs.joomla.org/Plugin/Events/User#onUserAfterLogin](https://docs.joomla.org/Plugin/Events/User#onUserAfterLogin)
In it, you can check the Code:

$_SERVER['HTTP_REFERER']

variable to know where you come from and then you can redirect to where you want based on that.
[ joomla.stackexchange.com/questions/16032...-message-in-joomla-3](https://joomla.stackexchange.com/questions/16032/how-to-redirect-user-with-system-message-in-joomla-3)

The following user(s) said Thank You: [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg5NTI1OC1sb2dpbi1yZWdpc3Rlci1yZWRpcmVjdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.074 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
