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

#   onPreprocessMenuItems hikashop menu system plugin

##

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

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

8 years 3 months ago -  8 years 3 months ago [\#296333](#296333) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  *[onPreprocessMenuItems hikashop menu system plugin](/forum/31-development/895439-onpreprocessmenuitems-hikashop-menu-system-plugin#296333 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.10 -- PHP version -- : 7.2  Hi  we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.  The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:  so we can call hikashop functions such as hikashop&#95;config() and hikahop&#95;isAllowed(). However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens? Thanks")* was created by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")*

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.2

Hi

we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.

The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:
Code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;

so we can call hikashop functions such as hikashop_config() and hikahop_isAllowed().
However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens?
Thanks

Last edit: 8 years 3 months ago by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile").

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

8 years 3 months ago [\#296341](#296341) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onPreprocessMenuItems hikashop menu system plugin](/forum/31-development/895439-onpreprocessmenuitems-hikashop-menu-system-plugin#296341 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.10 -- PHP version -- : 7.2  Hi  we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.  The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:  so we can call hikashop functions such as hikashop&#95;config() and hikahop&#95;isAllowed(). However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens? Thanks")*

Hi,

I don't know what com_dacshop is but it's not a HikaShop file you're loading if you have com_dacshop instead of com_hikashop.
I tried to load the helper of HikaShop in a onPreprocessMenuItems trigger of a system plugin and do overrides of com_banner translations and it worked just fine.

Please note that next version of HikaShop will have use that trigger to remove the different menu items based on the ACLs and it won't load the HikaShop helper (to avoid having to load it on every page of the backend which is not really nice).

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

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

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

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

8 years 3 months ago [\#296356](#296356) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[onPreprocessMenuItems hikashop menu system plugin](/forum/31-development/895439-onpreprocessmenuitems-hikashop-menu-system-plugin#296356 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.10 -- PHP version -- : 7.2  Hi  we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.  The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:  so we can call hikashop functions such as hikashop&#95;config() and hikahop&#95;isAllowed(). However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens? Thanks")*

That is great. We look forward to the next version then!

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

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