2

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

3 Answers 3

2

ALTER TABLE sequence_order_1 AUTO_INCREMENT=300005464;

1
  • Why is this downvoted?
    – Wouter
    Commented Nov 23, 2018 at 16:02
1

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.

1

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 and acknowledge you have read our privacy policy.

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