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

#   Override function in helper.php

##

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

Less More

- Posts: 25
- Thank you received: 2
-
-

5 years 4 months ago [\#334251](#334251) by [braverman](/forum/user/30455-braverman "View braverman's Profile")  *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#334251 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")* was created by *[braverman](/forum/user/30455-braverman "View braverman's Profile")*

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.28
-- PHP version -- : 7.4.20
-- Browser(s) name and version -- : all

Hi,

I have a question how to correctly override function in /administrator/components/com_hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop_encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.

Thanks, Jan

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

5 years 4 months ago [\#334252](#334252) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#334252 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")*

Hi,

Well, it's possible to override the whole function with a system plugin implementing a function of the same name.
However, I would rather recommend you do a normal plugin of the group "hikashop" and implement the onBeforeOrderNumberGenerate(&amp;$data, &amp;$result) and / or the onBeforeInvoiceNumberGenerate(&amp;$data, &amp;$result) events.
In $data, you'll have the information of the order and you can just set in $result whatever you want and it will become the order / invoice number.
If you want to know how to make a plugin, you can read the two first parts of the page [ www.hikashop.com/support/documentation/6...mentation.html#intro](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#intro) and use the link to the Joomla documentation which goes in depth about creating plugins for Joomla.

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

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

Less More

- Posts: 25
- Thank you received: 2
-
-

5 years 4 months ago -  5 years 4 months ago [\#334286](#334286) by [braverman](/forum/user/30455-braverman "View braverman's Profile")  Replied by *[braverman](/forum/user/30455-braverman "View braverman's Profile")* on topic *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#334286 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")*

Super, thanks, I'll do it this way. It would be fine to mention these events in Hikashop developer documentation.

Jan

Last edit: 5 years 4 months ago by [braverman](/forum/user/30455-braverman "View braverman's Profile").

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

5 years 4 months ago [\#334287](#334287) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#334287 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")*

Hi,

Thanks for the feedback. I've added these to the developer documentation.

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

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

Less More

- Posts: 239
- Thank you received: 8
-
-

4 years 2 months ago [\#344596](#344596) by [Bender](/forum/user/38688-bender "View Bender's Profile")  Replied by *[Bender](/forum/user/38688-bender "View Bender's Profile")* on topic *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#344596 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")*

What is helpers ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjkyNC1vdmVycmlkZS1mdW5jdGlvbi1pbi1oZWxwZXItcGhwP3RtcGw9bWFya2Rvd24=) 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 2 months ago [\#344601](#344601) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override function in helper.php](/forum/31-development/902924-override-function-in-helper-php#344601 "-- HikaShop version -- : 4.4.3 -- Joomla version -- : 3.9.28 -- PHP version -- : 7.4.20 -- Browser(s) name and version -- : all  Hi,  I have a question how to correctly override function in /administrator/components/com&#95;hikashop/helpers/helper.php? I need to change a little the generation of order number in hikashop&#95;encode function. I know how to override some class in helpers (eg image.php) but don't know how to do it with this helper functions.  Thanks, Jan")*

Hi,

Joomla is based on the MVC model ( [ en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) ). And HikaShop too.
So in HikaShop's folder, you'll find "classes" which is for the models, "controllers", for the controllers and "views" for the views.
The "helpers" folder contains files with helpers that can be used by the MVC elements which aren't tied to one view, one controller or one model. For example the "translation" helper has functions that are used by the views and controllers to manage the translations of the content.

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

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