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

#   hikashop override controllers folders of the frontend

##

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

Less More

- Posts: 138
- Thank you received: 4
-
-
-

1 year 11 months ago [\#364474](#364474) by [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")  *[hikashop override controllers folders of the frontend](/forum/26-product-category-display/908871-hikashop-override-controllers-folders-of-the-frontend#364474 "Hello, as i see on document &quot;  www.hikashop.com/support/documentation/6...ntation.html#classes &quot; we can override Admin controllers. well! so how can override Frontend one too? for example i want override &quot;users.php&quot; controller file on frontend of component! how can i handle it?")* was created by *[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")*

Hello,
as i see on document "[ www.hikashop.com/support/documentation/6...ntation.html#classes](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#classes)" we can override Admin controllers. well! so how can override Frontend one too?
for example i want override "users.php" controller file on frontend of component!
how can i handle it?

---

Joomla Developer \| am.ebrahimzadeh\[at\]gmail.com

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDg4NzEtaGlrYXNob3Atb3ZlcnJpZGUtY29udHJvbGxlcnMtZm9sZGVycy1vZi10aGUtZnJvbnRlbmQ/dG1wbD1tYXJrZG93bg==) 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: 86359
- Thank you received: 14294
-
-

1 year 11 months ago [\#364483](#364483) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[hikashop override controllers folders of the frontend](/forum/26-product-category-display/908871-hikashop-override-controllers-folders-of-the-frontend#364483 "Hello, as i see on document &quot;  www.hikashop.com/support/documentation/6...ntation.html#classes &quot; we can override Admin controllers. well! so how can override Frontend one too? for example i want override &quot;users.php&quot; controller file on frontend of component! how can i handle it?")*

Hi,

It's the same principle, but you need to add your override file in your frontend template instead of the backend template.

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

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

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

Less More

- Posts: 138
- Thank you received: 4
-
-
-

1 year 11 months ago [\#364489](#364489) by [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")  Replied by *[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")* on topic *[hikashop override controllers folders of the frontend](/forum/26-product-category-display/908871-hikashop-override-controllers-folders-of-the-frontend#364489 "Hello, as i see on document &quot;  www.hikashop.com/support/documentation/6...ntation.html#classes &quot; we can override Admin controllers. well! so how can override Frontend one too? for example i want override &quot;users.php&quot; controller file on frontend of component! how can i handle it?")*

thank you reply,
i want override this file:
SITE/components/com_hikashop/controllers/user.php

So i created override file on template on this path:
SITE/templates/cassiopeia/html/com_hikashop/administrator/controllers/user.override.php
(also i created on "SITE/templates/cassiopeia/html/com_hikashop/controllers/user.override.php" path too for testing.)

by this code:
Code:

&lt;?php class userControllerOverride extends userController { public function form() { $user = JFactory::getUser(); // Allow users in group ID 15 to access the form $allowedGroupId = 15; if ($user-&gt;guest &#124;&#124; in_array($allowedGroupId, $user-&gt;getAuthorisedGroups())) { hikaInput::get()-&gt;set('layout', 'form'); return $this-&gt;display(); } $app = JFactory::getApplication(); $config = hikashop_config(); $url = $config-&gt;get('redirect_url_when_registration_form_access_while_already_logged', ''); if(empty($url)) { global $Itemid; $url_itemid=(!empty($Itemid)?'&amp;Itemid='.$Itemid:''); $url = hikashop_completeLink('user&amp;task=cpanel'.$url_itemid, false, true); } else { $url = hikashop_cleanURL($url); } $app-&gt;redirect($url); return false; } }

but not affect!!

---

Joomla Developer \| am.ebrahimzadeh\[at\]gmail.com

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDg4NzEtaGlrYXNob3Atb3ZlcnJpZGUtY29udHJvbGxlcnMtZm9sZGVycy1vZi10aGUtZnJvbnRlbmQ/dG1wbD1tYXJrZG93bg==) 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: 86359
- Thank you received: 14294
-
-

1 year 11 months ago [\#364494](#364494) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[hikashop override controllers folders of the frontend](/forum/26-product-category-display/908871-hikashop-override-controllers-folders-of-the-frontend#364494 "Hello, as i see on document &quot;  www.hikashop.com/support/documentation/6...ntation.html#classes &quot; we can override Admin controllers. well! so how can override Frontend one too? for example i want override &quot;users.php&quot; controller file on frontend of component! how can i handle it?")*

Hi,

Right, thanks for your feedback.
You did everything correctly. The path SITE/templates/cassiopeia/html/com_hikashop/administrator/controllers/user.override.php is correct.
However, I can see on our end that a piece of code is missing for overrides to work for frontend controllers using template overrides.
So, the solution right now would be to create a system plugin to load the class yourself.
I've made a patch on our end so that it can work as expected.
Download again the install package of the latest version of HikaShop on our website and install it on yours and you'll get the patch. What you have now should then work without further changes.

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

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

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

Less More

- Posts: 138
- Thank you received: 4
-
-
-

1 year 11 months ago [\#364496](#364496) by [aminweb](/forum/user/38602-aminweb "View aminweb's Profile")  Replied by *[aminweb](/forum/user/38602-aminweb "View aminweb's Profile")* on topic *[hikashop override controllers folders of the frontend](/forum/26-product-category-display/908871-hikashop-override-controllers-folders-of-the-frontend#364496 "Hello, as i see on document &quot;  www.hikashop.com/support/documentation/6...ntation.html#classes &quot; we can override Admin controllers. well! so how can override Frontend one too? for example i want override &quot;users.php&quot; controller file on frontend of component! how can i handle it?")*

BOM! worked thank you man!

Yes i see on helper now changed to: Code:

$srcPath = HIKASHOP_BACK; if($group == 'controller') { $className = $class.ucfirst($group); if(hikashop_isClient('site')) $srcPath = HIKASHOP_FRONT; } $override = str_replace($srcPath, $path, constant(strtoupper('HIKASHOP_'.$group))).$class.'.override.php';

thank you Nicolas!

---

Joomla Developer \| am.ebrahimzadeh\[at\]gmail.com

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

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