How to change the Order number sequence in Magento2?
The default sequence 000000001, why there is no setting in Magento 2 CP to modify that?
How to change the Order number sequence in Magento2?
The default sequence 000000001, why there is no setting in Magento 2 CP to modify that?
ALTER TABLE sequence_order_1 AUTO_INCREMENT=300005464;
You can either:
Do a Setup Script with an InstallData.php and update the sequence there.
Install this module https://github.com/emizentech/magento2-customordernumber, i have tried this module in one of my environments and it works (it has the options to change the order number dynamically ). But to be honest i dont like using Observers . What i suggest is to go with the Script modification.
You have two places to change:
SHOW TABLE STATUS FROM `dbname` WHERE `name` LIKE 'sequence_order_1';
ALTER TABLE dbname.sequence_order_1 AUTO_INCREMENT = 9000001;
SHOW TABLE STATUS FROM `dbname` WHERE `name` LIKE 'sales_order';
ALTER TABLE dbname.sales_order AUTO_INCREMENT = 9000001;
This will change both the order 'order_id' and the increment id thats used alot.