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

#   Reset ID of the Orders

##

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

Less More

- Posts: 2
- Thank you received: 0
-
-

13 years 1 week ago [\#127955](#127955) by [burpete](/forum/user/28496-burpete "View burpete's Profile")  *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#127955 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")* was created by *[burpete](/forum/user/28496-burpete "View burpete's Profile")*

Hello,

I have to reset the number of orders starting with 1
I have performed the operation on the DB truncate the tables on hikashop_order_product and hikashop_order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 ..
I have to do something else to reset the id and restart the count of orders / invoices to be 1?

Thank you.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 week ago [\#128014](#128014) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#128014 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

Hi,

If you have well truncate, the id should start at 1 and the order code is based on the id.
As I remember nothing else is required.

[ www.hikashop.com/forum/4-how-to/76306-so...-database.html#79660](http://www.hikashop.com/forum/4-how-to/76306-solved-reset-order-number-from-database.html#79660)

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

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

Less More

- Posts: 101
- Thank you received: 9
-
-

12 years 11 months ago -  12 years 11 months ago [\#132409](#132409) by [Plotec](/forum/user/28323-plotec "View Plotec's Profile")  Replied by *[Plotec](/forum/user/28323-plotec "View Plotec's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#132409 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

I have the same problem. Isn't there a small how to, which operations on which tables have to be executed? Or even better, build in a reset button for that.

EDIT
Ok, works

Last edit: 12 years 11 months ago by [Plotec](/forum/user/28323-plotec "View Plotec's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2MjgxMy1yZXNldC1pZC1vZi10aGUtb3JkZXJzP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 11 months ago [\#132412](#132412) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#132412 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

It's not that complex. Just go in your phpmyadmin and click on the "truncate" or "empty" button for the tables hikashop_order hikashop_order_product and hikashop_history and you should be fine.

Having a button to do it is not a good idea. You would be amazed at the number of people clicking on buttons without realizing what they do (even validating the alert popup of the button) ![:)](/media/kunena/emoticons/8.png ":)")

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

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

Less More

- Posts: 154
- Thank you received: 4
-
-

12 years 2 months ago [\#168298](#168298) by [olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")  Replied by *[olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#168298 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

what tables should i truncate in order to reset the INVOICE NUMBER as well?

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 2 months ago [\#168306](#168306) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#168306 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

Hello,
Doing it on the table "hikashop_order " should do the job ![:)](/media/kunena/emoticons/8.png ":)").

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

- **[Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")**
- [![Sunshine's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35562.jpg)](/forum/user/35562-sunshine "View Sunshine's Profile")
- [ Offline](/forum/user/35562-sunshine)

Less More

- Posts: 75
- Thank you received: 0
-
-
-
-

11 years 8 months ago [\#189589](#189589) by [Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")  Replied by *[Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#189589 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

I can't get this to work. There are nothing in those tables. Because I allready deleted them from my hikashop order list.
What I want is to start with order number 1. How do I do this?

---

/Christina

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#189593](#189593) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#189593 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

Hi,

Even if you delete the entries in the table order ; the auto_increment is still store by the database (MySQL).
At this moment you have to perform a truncate or a alter of the table to change the auto increment value.

A French thread which provide the SQL queries:
[ www.hikashop.com/forum/5-support-en-fran...n-des-commandes.html](http://www.hikashop.com/forum/5-support-en-francais-french-support-/873799-remise-a-zero-de-la-numerotation-des-commandes.html)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")**
- [![Sunshine's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35562.jpg)](/forum/user/35562-sunshine "View Sunshine's Profile")
- [ Offline](/forum/user/35562-sunshine)

Less More

- Posts: 75
- Thank you received: 0
-
-
-
-

11 years 8 months ago [\#189619](#189619) by [Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")  Replied by *[Sunshine](/forum/user/35562-sunshine "View Sunshine's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#189619 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

![:)](/media/kunena/emoticons/8.png ":)") thanks for link, but I don't understand much french.
So you want me to run a query, for reseting the ordernumber?
And when you say truncate, you mean empty tables right? But they are empty.

---

/Christina

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 8 months ago [\#189636](#189636) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[RESET ID ORDER HELP!!!!!](/forum/35-orders-management/862813-reset-id-of-the-orders#189636 "Hello,  I have to reset the number of orders starting with 1 I have performed the operation on the DB truncate the tables on hikashop&#95;order&#95;product and hikashop&#95;order ... canceled their orders on hikashop but if I'm going to place an order begins with the last order example 17 .. I have to do something else to reset the id and restart the count of orders / invoices to be 1?  Thank you.")*

Hi,

Yes you indeed have to do a truncate mysql request, this allow to reset the auto increment value.

> The table handler does not remember the last used AUTO\_INCREMENT value, but starts counting from the beginning.

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

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

[](#top)
