1

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?

2
1

ALTER TABLE sequence_order_1 AUTO_INCREMENT=300005464;

1
  • Why is this downvoted? – Wouter Nov 23 '18 at 16:02
0

You can either:

  1. Do a Setup Script with an InstallData.php and update the sequence there.

  2. 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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.