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

#   Manual Redirect Weirdness

##

- **[icomex](/forum/user/4967-icomex "View icomex's Profile")**
- [![icomex's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4967.png)](/forum/user/4967-icomex "View icomex's Profile") Topic Author
- [ Offline](/forum/user/4967-icomex)

Less More

- Posts: 149
- Thank you received: 6
-
-

4 years 3 months ago [\#343459](#343459) by [icomex](/forum/user/4967-icomex "View icomex's Profile")  *[Manual Redirect Weirdness](/forum/31-development/904771-manual-redirect-weirdness#343459 "-- HikaShop version -- : 4.6.0 -- Joomla version -- : 4.1.5 -- PHP version -- : 7.4.30  I have a strange one.  To simplify the User Registration Forms, I am using Layout Template overrides. We are using a large set of User custom fields as a User Profile which are only needed for a small set of Joomla Users, but are rarely needed for Store Customers - we can't make them &quot;required&quot; so we modified the Registration templates.  All of that is working fine, both through registrations via purchases and the online registration form (HikaShop's form, not Joomla's).  If a registered Joomla User accidentally visits the Registration page, I want to redirect them to the custom &quot;Welcome&quot; article we built. Using Joomla's access control on the Menu item gives us the benefit of hiding our menu's &quot;Create Account&quot; link from registered visitors, but it redirects a User back to the Home page, along with an error message we'd rather customize. I don't think there's a way to customize that built-in redirect, so I'd rather handle redirection on the Registration page itself.  This sounds simple: just add an application-&gt;redirect() after checking the User's Guest property. The problem is that for some unknown reason, my test-driven redirect's address value gets overridden by one which sends the browser to HikaShop's Customer Dashboard page - which we don't even run an instance of. (the redirected url becomes &quot;/component/hikashop/user/cpanel&quot;)  I have no idea where to even look for this problem. Suggestions?  Thanks.")* was created by *[icomex](/forum/user/4967-icomex "View icomex's Profile")*

-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 7.4.30

I have a strange one.

To simplify the User Registration Forms, I am using Layout Template overrides. We are using a large set of User custom fields as a User Profile which are only needed for a small set of Joomla Users, but are rarely needed for Store Customers - we can't make them "required" so we modified the Registration templates.

All of that is working fine, both through registrations via purchases and the online registration form (HikaShop's form, not Joomla's).

**If a registered Joomla User accidentally visits the Registration page, I want to redirect them to the custom "Welcome" article we built.** Using Joomla's access control on the Menu item gives us the benefit of hiding our menu's "Create Account" link from registered visitors, but it redirects a User back to the Home page, along with an error message we'd rather customize. I don't think there's a way to customize that built-in redirect, so I'd rather handle redirection on the Registration page itself.

This sounds simple: just add an **application-&gt;redirect()** after checking the User's Guest property. The problem is that **for some unknown reason, my test-driven redirect's address value gets overridden by one which sends the browser to HikaShop's Customer Dashboard page** - which we don't even run an instance of. (the redirected url becomes "/component/hikashop/user/cpanel")

I have no idea where to even look for this problem. Suggestions?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDc3MS1tYW51YWwtcmVkaXJlY3Qtd2VpcmRuZXNzP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

4 years 3 months ago [\#343463](#343463) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Manual Redirect Weirdness](/forum/31-development/904771-manual-redirect-weirdness#343463 "-- HikaShop version -- : 4.6.0 -- Joomla version -- : 4.1.5 -- PHP version -- : 7.4.30  I have a strange one.  To simplify the User Registration Forms, I am using Layout Template overrides. We are using a large set of User custom fields as a User Profile which are only needed for a small set of Joomla Users, but are rarely needed for Store Customers - we can't make them &quot;required&quot; so we modified the Registration templates.  All of that is working fine, both through registrations via purchases and the online registration form (HikaShop's form, not Joomla's).  If a registered Joomla User accidentally visits the Registration page, I want to redirect them to the custom &quot;Welcome&quot; article we built. Using Joomla's access control on the Menu item gives us the benefit of hiding our menu's &quot;Create Account&quot; link from registered visitors, but it redirects a User back to the Home page, along with an error message we'd rather customize. I don't think there's a way to customize that built-in redirect, so I'd rather handle redirection on the Registration page itself.  This sounds simple: just add an application-&gt;redirect() after checking the User's Guest property. The problem is that for some unknown reason, my test-driven redirect's address value gets overridden by one which sends the browser to HikaShop's Customer Dashboard page - which we don't even run an instance of. (the redirected url becomes &quot;/component/hikashop/user/cpanel&quot;)  I have no idea where to even look for this problem. Suggestions?  Thanks.")*

Hi,

HikaShop has a mechanism to automamtically redirect the user to the user control panel if someone already logged in tries to Access thé registration form.
This is done in the controller of the registration form. So supposing you're adding your code in a view override of the registration form it's normal it doesn't do anything as the controller code runs before.
What you would have to do is to implement joomla's onAfterRoute event in a system plugin to add your code before the controller.

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

- **[icomex](/forum/user/4967-icomex "View icomex's Profile")**
- [![icomex's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4967.png)](/forum/user/4967-icomex "View icomex's Profile") Topic Author
- [ Offline](/forum/user/4967-icomex)

Less More

- Posts: 149
- Thank you received: 6
-
-

4 years 3 months ago [\#343520](#343520) by [icomex](/forum/user/4967-icomex "View icomex's Profile")  Replied by *[icomex](/forum/user/4967-icomex "View icomex's Profile")* on topic *[Manual Redirect Weirdness](/forum/31-development/904771-manual-redirect-weirdness#343520 "-- HikaShop version -- : 4.6.0 -- Joomla version -- : 4.1.5 -- PHP version -- : 7.4.30  I have a strange one.  To simplify the User Registration Forms, I am using Layout Template overrides. We are using a large set of User custom fields as a User Profile which are only needed for a small set of Joomla Users, but are rarely needed for Store Customers - we can't make them &quot;required&quot; so we modified the Registration templates.  All of that is working fine, both through registrations via purchases and the online registration form (HikaShop's form, not Joomla's).  If a registered Joomla User accidentally visits the Registration page, I want to redirect them to the custom &quot;Welcome&quot; article we built. Using Joomla's access control on the Menu item gives us the benefit of hiding our menu's &quot;Create Account&quot; link from registered visitors, but it redirects a User back to the Home page, along with an error message we'd rather customize. I don't think there's a way to customize that built-in redirect, so I'd rather handle redirection on the Registration page itself.  This sounds simple: just add an application-&gt;redirect() after checking the User's Guest property. The problem is that for some unknown reason, my test-driven redirect's address value gets overridden by one which sends the browser to HikaShop's Customer Dashboard page - which we don't even run an instance of. (the redirected url becomes &quot;/component/hikashop/user/cpanel&quot;)  I have no idea where to even look for this problem. Suggestions?  Thanks.")*

Alright - it looks like Hika and I had the same plans, yours are just implemented first.

I believe I understand about 95% of your explanation, which should be enough to build a working plugin and either solve the issue or come up with more relevant questions.

As a suggestion, the ability to override that redirect destination would be a useful Hikashop preference setting.

Thank you for your guidance.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDc3MS1tYW51YWwtcmVkaXJlY3Qtd2VpcmRuZXNzP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

4 years 3 months ago [\#343524](#343524) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Manual Redirect Weirdness](/forum/31-development/904771-manual-redirect-weirdness#343524 "-- HikaShop version -- : 4.6.0 -- Joomla version -- : 4.1.5 -- PHP version -- : 7.4.30  I have a strange one.  To simplify the User Registration Forms, I am using Layout Template overrides. We are using a large set of User custom fields as a User Profile which are only needed for a small set of Joomla Users, but are rarely needed for Store Customers - we can't make them &quot;required&quot; so we modified the Registration templates.  All of that is working fine, both through registrations via purchases and the online registration form (HikaShop's form, not Joomla's).  If a registered Joomla User accidentally visits the Registration page, I want to redirect them to the custom &quot;Welcome&quot; article we built. Using Joomla's access control on the Menu item gives us the benefit of hiding our menu's &quot;Create Account&quot; link from registered visitors, but it redirects a User back to the Home page, along with an error message we'd rather customize. I don't think there's a way to customize that built-in redirect, so I'd rather handle redirection on the Registration page itself.  This sounds simple: just add an application-&gt;redirect() after checking the User's Guest property. The problem is that for some unknown reason, my test-driven redirect's address value gets overridden by one which sends the browser to HikaShop's Customer Dashboard page - which we don't even run an instance of. (the redirected url becomes &quot;/component/hikashop/user/cpanel&quot;)  I have no idea where to even look for this problem. Suggestions?  Thanks.")*

Hi,

Yes, thank you for your feedback. We'll add this as a hidden option.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDc3MS1tYW51YWwtcmVkaXJlY3Qtd2VpcmRuZXNzP3RtcGw9bWFya2Rvd24=) 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.060 seconds

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