Page 1 of 1

How To Reset Order ID back to 1 Opencart 2.1.0.2

Posted: Sat Mar 18, 2017 8:43 am
by brettcyr
I have created a new cart and ran some test products. The Order ID was up to 7 and when I deleted the orders and tried to get the order id to go back to 0 I went to the phpadmin and ran ALTER TABLE `oc_order` AUTO_INCREMENT = 0; and get the return in the image shown. I try a test order and it just keeps increasing by 1 and now up to 10 instead of starting over at 1. Is there something I'm missing or skipping after running the above code?

Re: How To Reset Order ID back to 1 Opencart 2.1.0.2

Posted: Sat Mar 18, 2017 3:08 pm
by tingwing
i donot think this would bother your business
how to back to 0?
i think,what is it doing is adding 1 to the current biggest orderID for the latest orderID.
so delete all that orders at backend-sale-order you created when tested .

if this doesot work,you need to find " the current biggest orderID" by phpmyadmin,then change it to 0

Re: How To Reset Order ID back to 1 Opencart 2.1.0.2

Posted: Sat Mar 18, 2017 3:59 pm
by thekrotek
ALTER TABLE tablename AUTO_INCREMENT = 1