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

#   Order Number

##

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

Less More

- Posts: 61
- Thank you received: 3
-
-

2 years 3 months ago [\#362619](#362619) by [demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")  *[Order Number](/forum/35-orders-management/908497-order-number#362619 "-- url of the page with the problem -- : demoisellegol.fr -- HikaShop version -- : 5.1.0 -- Joomla version -- : 5.1.2 -- PHP version -- : 8.1  Hi how can set my order numbers to a random 8 digit number ?  thanks")* was created by *[demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")*

-- url of the page with the problem -- : demoisellegol.fr
-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1

Hi
how can set my order numbers to a random 8 digit number ?

thanks

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

2 years 3 months ago -  2 years 3 months ago [\#362625](#362625) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Order Number](/forum/35-orders-management/908497-order-number#362625 "-- url of the page with the problem -- : demoisellegol.fr -- HikaShop version -- : 5.1.0 -- Joomla version -- : 5.1.2 -- PHP version -- : 8.1  Hi how can set my order numbers to a random 8 digit number ?  thanks")*

Hello,

In **Component** =&gt; **HikaShop** =&gt; **Configuration**, then Main tab, and finally **Order** part, you will find an input to define your **order number**, learn more in our **[ documentation](https://www.hikashop.com/support/documentation/54-hikashop-config.html#main_order)**.

Regards

Last edit: 2 years 3 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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

Less More

- Posts: 61
- Thank you received: 3
-
-

2 years 3 months ago [\#362629](#362629) by [demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")  Replied by *[demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")* on topic *[Order Number](/forum/35-orders-management/908497-order-number#362629 "-- url of the page with the problem -- : demoisellegol.fr -- HikaShop version -- : 5.1.0 -- Joomla version -- : 5.1.2 -- PHP version -- : 8.1  Hi how can set my order numbers to a random 8 digit number ?  thanks")*

I know where to change the code
I dont know the code

can you tell me what should i exactly put in that field for desired order number ?

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

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

Less More

- Posts: 61
- Thank you received: 3
-
-

2 years 3 months ago [\#362630](#362630) by [demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")  Replied by *[demoisellegol](/forum/user/79354-demoisellegol "View demoisellegol's Profile")* on topic *[Order Number](/forum/35-orders-management/908497-order-number#362630 "-- url of the page with the problem -- : demoisellegol.fr -- HikaShop version -- : 5.1.0 -- Joomla version -- : 5.1.2 -- PHP version -- : 8.1  Hi how can set my order numbers to a random 8 digit number ?  thanks")*

I managed to do what i want by reading the documentation

my problem is i want the orders IDs be a 5 digit RANDOM number not sequential

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwODQ5Ny1vcmRlci1udW1iZXI/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: 86583
- Thank you received: 14324
-
-

2 years 3 months ago [\#362634](#362634) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Order Number](/forum/35-orders-management/908497-order-number#362634 "-- url of the page with the problem -- : demoisellegol.fr -- HikaShop version -- : 5.1.0 -- Joomla version -- : 5.1.2 -- PHP version -- : 8.1  Hi how can set my order numbers to a random 8 digit number ?  thanks")*

Hi,

In that case, you need to develop a joomla plugin of the group "hikashop" and implement in it the event onBeforeOrderNumberGenerate(&amp;$order, &amp;$order_number)

It's quite simple with PHP's rand function ( [ www.php.net/manual/en/function.rand.php](https://www.php.net/manual/en/function.rand.php) ): Code:

function onBeforeOrderNumberGenerate(&amp;$order, &amp;$order_number){ $order_number = rand(10000, 99999); }

Note that this code doesn't check if an order already exists with the randomly selected number. If you want to add that check, it's possible. You'll need to run a MySQL query on the hikashop_order table.

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

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