Post by johnseito » Fri Aug 20, 2010 9:52 am

I made a couple of test orders so now is a bogus order number, how do you reset the order number? Thx

Active Member

Posts

Joined
Fri Aug 06, 2010 9:42 pm

Post by cevarief » Fri Aug 20, 2010 1:50 pm

Just execute sql query to empty your order table :

Code: Select all

TRUNCATE yourtableprefix_order;
or you can alter it to reset the order_id field (autoincrement) to zero

Code: Select all

ALTER TABLE yourtableprefix_order AUTO_INCREMENT = 0;
The first order id inserted later will be 0.

It's always better you delete all order from backend to clean up order related table such as order history, order total etc and then reset the id by executing one of sql above.

Active Member

Posts

Joined
Wed Jun 02, 2010 10:52 pm

Post by johnseito » Fri Aug 20, 2010 9:37 pm

how do you go to the sql query to empty your order table

Active Member

Posts

Joined
Fri Aug 06, 2010 9:42 pm

Post by cevarief » Fri Aug 20, 2010 10:43 pm

If you have cpanel, you can use phpmyadmin, if you're in localhost you can download mysql frontend like heidisql and you can execute the sql code there.

To Q, what do you think if backend has some sort of placeholder/menu for this kind of utility stuff, so we can easily add some utility stuff created by oc users. Such as backup stuff, reset order id, empty cache which are not covered by oc yet or any other things.

Active Member

Posts

Joined
Wed Jun 02, 2010 10:52 pm

Post by johnseito » Sat Aug 21, 2010 8:26 pm

I don't know what I have and I don't even know how to get to what you just say. Which file is it or do I go to my web host??

Active Member

Posts

Joined
Fri Aug 06, 2010 9:42 pm

Post by oc_rich » Mon May 28, 2012 1:42 pm

Though this post is very old, came across it today via google search, after a bit of exploring the order related tables, came to this conclusion, may this info come handy for future seekers on the same subject

Fire the below sql using http://www.adminer.org (installation of this tool on your server is pretty straight forward)

TRUNCATE TABLE `order`;
TRUNCATE TABLE `order_history`;
TRUNCATE TABLE `order_option`;
TRUNCATE TABLE `order_product`;
TRUNCATE TABLE `order_total`;

- Rich

Newbie

Posts

Joined
Tue Nov 22, 2011 5:34 pm

Post by Klimskady » Wed May 30, 2012 10:12 am

Decent info, thanks.

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by Avvici » Wed May 30, 2012 2:30 pm

oc_rich wrote:Though this post is very old, came across it today via google search, after a bit of exploring the order related tables, came to this conclusion, may this info come handy for future seekers on the same subject

Fire the below sql using http://www.adminer.org (installation of this tool on your server is pretty straight forward)

TRUNCATE TABLE `order`;
TRUNCATE TABLE `order_history`;
TRUNCATE TABLE `order_option`;
TRUNCATE TABLE `order_product`;
TRUNCATE TABLE `order_total`;

- Rich
I think it's important to clarify that this is for emptying ALL ROW DATA in a table. There are two topics going on in this thread so I wanted to be sure that people aren't TRUNCATING to try and reset the Order_Id.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC
Who is online

Users browsing this forum: No registered users and 31 guests