Hi, I am KD I am a new magento developer.
I just want to seek help about the requirements I need to do for a services e-commerce website.
I appreciate your help in advance.
1. How can I make the order number from the default sequence to this sequence with Prefix? (Ex. ESO-50100)
2. How can I make the invoice number from the default sequence to this sequence with Prefix? (Ex.ESI-10100)
And for the last please see the photos on what I need to achieve on the admin customer page.
Thank you for your help ing advance,
Solved! Go to Solution.
Go to your database from phpmyadmin,
Here _1 is used for store id after tablename.
Default Frontend store id is 1. if you have multi store then you have to set query for each store with table name like sequence_order_2 upto sequence_order_.*
Enter below query for table sequence_order_1 is used for default store. If you have multiple store you have to set tablename as per store id in below query.
This is only used for order placed from frontend.
sequence_order_1 is used for order id management in magento 2.
ALTER TABLE sequence_order_1 AUTO_INCREMENT=155555551;
Next order id is start from 155555551.
Below Query is defined for INVOICE, if you want to change invoice id
ALTER TABLE sequence_invoice_1 AUTO_INCREMENT=155555551;
For Shipment ALTER TABLE sequence_shipment_1 AUTO_INCREMENT=155555551;
To chnange prefix do changes in sale_sequence_profile
For more info please follow below link:
https://bsscommerce.com/blog/complete-tutorial-guide-change-order-number-magento-2/
Go to your database from phpmyadmin,
Here _1 is used for store id after tablename.
Default Frontend store id is 1. if you have multi store then you have to set query for each store with table name like sequence_order_2 upto sequence_order_.*
Enter below query for table sequence_order_1 is used for default store. If you have multiple store you have to set tablename as per store id in below query.
This is only used for order placed from frontend.
sequence_order_1 is used for order id management in magento 2.
ALTER TABLE sequence_order_1 AUTO_INCREMENT=155555551;
Next order id is start from 155555551.
Below Query is defined for INVOICE, if you want to change invoice id
ALTER TABLE sequence_invoice_1 AUTO_INCREMENT=155555551;
For Shipment ALTER TABLE sequence_shipment_1 AUTO_INCREMENT=155555551;
To chnange prefix do changes in sale_sequence_profile
For more info please follow below link:
https://bsscommerce.com/blog/complete-tutorial-guide-change-order-number-magento-2/
Hello @kd_bansil,
You can customize it. In this article, we’ll provide you with some tips to change the default Magento 2 order number in the correct way, they are:
Tip 1: Make Changes to Order Number Directly in Database Magento 2
First of all, you need to open your PHP Admin database. Then find and open the table “sale_sequence_profile.”
This is the structure of table “sale_sequence_profile”: https://www.screencast.com/t/aPKgbO1zk1Lv
After that, you can make changes to default order number on your Magento 2 website:
a. Change Order Increment ID
This is the guide to help you change the step between 2 continuous order numbers.
UPDATE ‘sales_sequence_profile’ SET ‘step’ = X WHERE ‘meta_id’ = 5;Note: “meta_id” is gotten from table “sales_sequence_meta”
b. Change Order Number Prefix
Following this structure to add the prefix to the order number:
UPDATE ‘sales_sequence_profile’ SET ‘prefix’ = ‘X’ WHERE ‘meta_id’ = 5;
c. Change Order Number Suffix
UPDATE ‘sales_sequence_profile’ SET ‘suffix’= ‘X’ WHERE ‘meta_id’ = 5;
d. Change Order Number Start-value
UPDATE ‘sales_sequence_profile’ SET ‘start_value’= X WHERE ‘meta_id’ = 5;
e. Change Pad-length
The constant DEFAULT_PATTERN is set in: /vendor/magento/module-sales-sequence/Model/Sequence.php, line 22.
https://www.screencast.com/t/wyYZUnYK
To avoid editing module core, you can change this in a custom module by creating etc/di.xml with the following contents:
https://www.screencast.com/t/CTWyM75tG3j
After setting, you will get a new custom order number like this:
order_number = prefix + ((sequence_value – start_value) * step + start_value) {padded to X digits} + suffix
For example, you set: – step = ‘10’’ – prefix = ‘Bss-’ – suffix = ‘-M2’ – start_value = ‘1’ – DEFAULT_PATTERN = “%s%’.03d%s”
And last sequence_value = 2 => next sequence_value = 3
Then next order number is Bss-021-M2
Note: sequence_value is gotten from table “sequence_order_1”
Tip 2: Use Magento 2 Custom Order Number extension
The damage of using code is that it directly intervenes in the database, which may cause harm to your website especially for those who do not get familiar with it. Hence, another tip to change order number simply safely is to use the support of a convenient extension. You can refer Magento 2 Custom Order Number extension. The extension is very user-friendly so admins can make changes to order number at ease. This module not only allows you to make a change to order number but also shipment, credit memo, and invoice number. One plus point is that you can edit the sale numberings individually for each store view.
https://www.screencast.com/t/J3BgwGFH
--
If my answer is useful, please Accept as Solution & give Kudos
Hi @kd_bansil
To change the order sequence from default to the customized - you need to installed and configured the extension or you will required to do customization - as by default there is no functionality available
So here i am suggesting one extension , which helps you to change the invoice/order/shipping all kind of sequence : https://amasty.com/custom-order-number-for-magento-2.html
Hope it helps !
Thank you it helps a lot.