Hi,
I've done a lot of testing purchases on my commerce site now question is: how to reset order id's to start from 1 again? Tried to clear the database, searched for strings but still it keeps rolling from last id + 1.

Any ideas?

Comments

rszrama’s picture

Status: Active » Fixed

In phpMyAdmin under the Operations tab you need to reset the auto increment value to 1 for the commerce_order table.

amfis’s picture

Thanks for the tip.
Just to add to others: before doing this it is needed to empty commerce_order table.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ron williams’s picture

SQL code option: ALTER TABLE commerce_order AUTO_INCREMENT=1

garethhallnz’s picture

Issue summary: View changes

Just contributed a module to help with this.
Commerce Reset

giorgosk’s picture

#4 works great thanks

el_reverend’s picture

StatusFileSize
new21.39 KB

I've ran
ALTER TABLE `commerce_order` AUTO_INCREMENT = 1000; (as seen here: https://drupalcommerce.org/questions/3172/how-can-i-change-starting-orde...)

and that worked great for all new customers. In a recent test I created a new order as the superuser and it turns out that it used the original ordering numbers!

Well thats odd. I was not aware that commerce uses numbers based on the user - and that seems weird. Does anyone have an idea to why or how to make it uniform accross all users?