2

I am trying to implement feature that Orders placed on M2 should start with a ' 3 ' instead of a ' 2 '

This will help me with easily identifying new orders while we move test orders to production and for post live tracking.

What would be the most convenient method to do so programmatically, following by best practice ?

1
  • any thoughts would be greatly appriciated.
    – devhs
    Commented Apr 8, 2021 at 5:27

3 Answers 3

1

You can change it from the table sales_sequence_profile by changing value of prefix column for the particular meta_id

You will find order meta_id from sales_sequence_meta this table based on your store view.

5
  • Thanks for the answer, i have opened & checked tables. This is it ? Everything else would be managed automatically by magento if i change prefix for a store's meta id ?
    – devhs
    Commented Apr 8, 2021 at 4:42
  • Also i would like to ask if it can be done programmatically ?
    – devhs
    Commented Apr 8, 2021 at 4:42
  • yes after changing value in table it will work. I don't know about the code. till now I have done with the db only Commented Apr 8, 2021 at 4:51
  • ok rakesh thanks for the answer, i have to perform this programmatically, so i need to check that.
    – devhs
    Commented Apr 8, 2021 at 5:04
  • once you get the solution using programmatically post it in your question so it will helpful for other as well Commented Apr 8, 2021 at 10:48
0
  1. Open your database
  2. Find & click on the table called: sequence_order_1
  3. Change "AUTO_INCREMENT" edit to desired order number. like 30000526

This should work

9
  • Thanks for the answer, That's it ? Everything else would be managed automatically by magento ? For credit memo, invoice, shipment ?
    – devhs
    Commented Apr 8, 2021 at 4:45
  • Also would like to ask if it will work for multiple stores ?
    – devhs
    Commented Apr 8, 2021 at 4:45
  • For multiple stores you will find multiple sequences like _1, _2 etc Commented Apr 8, 2021 at 4:55
  • For invoice shipment, credit memo you have other tables like this. sequence_creditmemo_0, sequence_creditmemo_1, sequence_invoice_0, sequence_invoice_1 etc Commented Apr 8, 2021 at 4:56
  • ok so i need to change there in those table also ?
    – devhs
    Commented Apr 8, 2021 at 5:04
0

You can find the answer at https://www.mageplaza.com/kb/change-order-prfix-increment-id-suffix-invoice.html I hope you find this helpful!

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.