Order numbers not getting reset

I am running ver 2.1.3. I had around 7000 orders in my database which I have deleted and also set the initial order ID as 1 in the administrator settings but still the order nos. are being generated from the order # 7001.:confused:



Has anyone faced the same problem?

use phpMyAdmin to change the auto-increment value to 1. It will at least give you the error if any.

[quote name=‘tbirnseth’]use phpMyAdmin to change the auto-increment value to 1. It will at least give you the error if any.[/QUOTE]



Thanks. :stuck_out_tongue: Sorry for sounding a noobie but where do I see the auto increment value in phpMyadmin? I do see the Cs_cart_order tables.

On the Operations tab. On the left side in the box labled Table Options you see an AUTO_INCREMENT label with a text box. The value is the last AUTO_INCREMENT value used.



I believe the admin panel does NOT let you go backward so it must be done directly in the DB.

Go to

[QUOTE]

admin.php?dispatch=database.manage[/QUOTE]



Backup one table "cscart_orders "



Download and open backed up .sql file with text editor that handles large text files, used EditPad Lite



After


[QUOTE]DROP TABLE IF EXISTS cscart_orders;

CREATE TABLE cscart_orders (



)[/QUOTE]



Delete every “INSERT INTO cscart_orders”



Save, upload and restore .sql


[QUOTE]

admin.php?dispatch=database.manage[/QUOTE]



Now go to

[QUOTE]

admin.php?dispatch=settings.manage[/QUOTE]



“Initial order ID value” set to “1”



If db will contain at least one line of “INSERT INTO cscart_orders” this “Initial order ID value” will not take any effect.

@darius - That method is fraught with problems… Take for instance an order_id of 10 that exists in the system. There will be corresponding info in order_details, order_data and several other tables.



So now when the new system hits the new order 10, there is a high liklihood that the data from the old order 10 will be mixed with the new. Possibly payment info, product options and even products.



Unless you can identify all the tables (and the serialized data within those tables that reference order id’s then just deleting the elements in the orders table could cause major (and difficult to figure out) problems down the road.

Yea you may be right, I did not looked too much in to it.