Reset ID of the Orders

  • Posts: 2
  • Thank you received: 0
11 years 1 month ago #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_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 or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #128014

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

Please Log in or Create an account to join the conversation.

  • Posts: 101
  • Thank you received: 9
11 years 1 week ago #132409

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: 11 years 1 week ago by Plotec.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 1 week ago #132412

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) :)

Please Log in or Create an account to join the conversation.

  • Posts: 154
  • Thank you received: 4
10 years 3 months ago #168298

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

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 3 months ago #168306

Hello,
Doing it on the table "hikashop_order " should do the job :).

Please Log in or Create an account to join the conversation.

  • Posts: 75
  • Thank you received: 0
9 years 9 months ago #189589

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 or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 9 months ago #189593

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

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 75
  • Thank you received: 0
9 years 9 months ago #189619

:) 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 or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #189636

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 or Create an account to join the conversation.

Time to create page: 0.117 seconds
Powered by Kunena Forum