cancel
Showing results for 
Search instead for 
Did you mean: 

How to Reset Order Number in Magento 2.2.2

How to Reset Order Number in Magento 2.2.2

 

hi we have installed magento 2.2.2 in our store,,,,,,

 

We have lot of test orders and we deleted that orders using mage comp Delete Orders Extension,,,,,,

 

Now we need to reset order Number to 1 (Starting from First)....Because we have so many test orders,,,,previously,,,,,,

 

How to reset order number to 1 ,,,,,,Is it possible by admin side???????

 

or Any other possible solutions,,kindly help us

7 REPLIES 7

Re: How to Reset Order Number in Magento 2.2.2

You have to lookup below links for your customization,

https://www.classyllama.com/blog/m2-incrementid

 

One of the paid extension is also available from below link,

https://amasty.com/custom-order-number-for-magento-2.html

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: How to Reset Order Number in Magento 2.2.2

Hello @Dhanaa

 

First of all, Thanks for using MageComp delete order extension for your store.

 

As per your need to reset order sequence, you need to change order autoincrement value from your database.

You can either do it manually by navigating to sales_order table and from operations, simply change the autoincrement value as Shown in this screenshot.

 

Or you can change autoincrement value by firing SQL query to your database as shown below.

ALTER TABLE SALES_ORDER AUTO_INCREMENT=1;
Was my answer helpful? You can accept it as a solution.
200+ Premium Magento 2 Extensions Need help? Hire Magento Developer

Re: How to Reset Order Number in Magento 2.2.2

It is Already 1 in that table

Re: How to Reset Order Number in Magento 2.2.2

Hello,

You can take a look at https://bsscommerce.com/magento-2-custom-order-number-extension.html.

This tool helps you change the order number flexibly and of course, the order number can be reset whenever you want.

Re: How to Reset Order Number in Magento 2.2.2

Hello,

I got the same issues but my issues resolved by magento 2 custom order number extension 

Re: How to Reset Order Number in Magento 2.2.2

Unfortunately Magento 2 uses the Auto_increment field of the sequence table, so the only way to reset the order number  is to reset the Auto_increment field of the sequence table.

With ALTER TABLE one can only incease the Auto_Increment field, not decrease it so that won't work either. The only solution is to first TRUNCATE the table, this will delete all rows in the table ánd reset the Auto_increment to 1.  After that you could use the ALTER TABLE to set it to whatever start value you want....

 

So if you created 30 test orders that you've deleted and you want to start your first real order with order ID 5 for store ID 2, the way to go is 

 

TRUNCATE TABLE sequence_order_2 ;
ALTER TABLE sequence_order_2 AUTO_INCREMENT=4

 

Re: How to Reset Order Number in Magento 2.2.2

@aqcycling -

 

You have answered in 2 lines what people across the world wide internets answer with convoluted instruction, modules, plugins, pages and edits of incorrect database methods, and a complete non-understanding of the original question.

 

Thank you, I knew it should have been simple. This works perfectly.

 

AG