cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change the starting order number?

SOLVED

Can I change the starting order number?

I'd rather not use order numbers like  #100000003   etc, but would like to have fewer digits and/or just leading zeros instead of that 1 stuck there.

 

Is there a way to do this without an expensive extension?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can I change the starting order number?

Hi,

 

Yes, you can. To do this you will just need phpmyadmin. Please note that following the instruction below is at your own risk. Definitely make a database backup if you are not sure what you are doing.

 

1. Open your store database. You can do this in phpmyadmin (if you have one) or MySQL Workbench (if you have remote MySQL connections allowed) or in any software that allows you to browse a database.

2. Find table called eav_entity_type and open it.

3. In this table find row which has entity_type_code = order. Look at value in entity_type_id in that row and remember it, it's important. I will assume that order entity ID is 5.

http://screencast.com/t/lhL5Sh77B

4. Now find table called eav_entity_store in your database and open it.

5. If you already have made some orders you should see a row with entity_type_id = 5. If not - the table might be empty. If it's empty - I'd recommend you to create an order manually to auto-generate the row. You might also see multiple rows in that table, but you should only focus on entity_type_id = 5.

Should look like this: http://screencast.com/t/otx8w4uA2EZ

6. When you have the row with entity_type_id = 5 then you can modify increment_prefix and increment_last_id values in it. Delete value in increment_prefix (this will remove leading 1) and set increment_last_id to whatever you want. I'd recommend you to set the new value not lower than part without "10000000", e.g. if it was 100000007 - set it to 7.

Should look like this: http://screencast.com/t/oTdIn6NIhPU

7. Now go back to table eav_entity_type, find the same row with entity_type_id = 5 and set increment_pad_length = 1 (this will remove zeros 0000000).

Should look like this: http://screencast.com/t/Wn6roL6Agd

8. Try to place a new order and check what ID it will have.

Should look like this: http://screencast.com/t/g7lxt8Szs5

 

Let me know how it goes. Likes and kudos are very welcome :-)

 

P.S. You can play around with numbers in increment_pad_length (number of 0000000) and increment_prefix (leading digit) to make the order ID look exactly how you want. Just make sure you have a database backup ;-)

-------Store Manager for Magento 1.x and 2.x - enhances the functionality of default admin web interface, speeds up inventory management, automates daily tasks.

View solution in original post

14 REPLIES 14

Re: Can I change the starting order number?

Hi,

Yes there is a plugin that does exactly that.

 

It is available to download from:

https://github.com/aligent/Magento_SetStartOrderNumber

 

Hope this helps.

Andrew

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Can I change the starting order number?

Hi @williwaw

iweb_p3mbo has suggested a good solution.

 

However, if need more than just changing the starting number, you can have a look at this extension - https://amasty.com/custom-order-number.html

It will enable you to:

  • Set any starting numbers for all document types
  • Specify increment intervals and numbers length
  • Use prefixes and date postfixes for numbers
  • Mask important data to protect your business
  • Adjust numbers to your local legislation

 

Was my answer helpful? You can accept it as a solution.
230+ professional extensions for M1 & M2 with free lifetime updates!

Re: Can I change the starting order number?

Hi,

 

Yes, you can. To do this you will just need phpmyadmin. Please note that following the instruction below is at your own risk. Definitely make a database backup if you are not sure what you are doing.

 

1. Open your store database. You can do this in phpmyadmin (if you have one) or MySQL Workbench (if you have remote MySQL connections allowed) or in any software that allows you to browse a database.

2. Find table called eav_entity_type and open it.

3. In this table find row which has entity_type_code = order. Look at value in entity_type_id in that row and remember it, it's important. I will assume that order entity ID is 5.

http://screencast.com/t/lhL5Sh77B

4. Now find table called eav_entity_store in your database and open it.

5. If you already have made some orders you should see a row with entity_type_id = 5. If not - the table might be empty. If it's empty - I'd recommend you to create an order manually to auto-generate the row. You might also see multiple rows in that table, but you should only focus on entity_type_id = 5.

Should look like this: http://screencast.com/t/otx8w4uA2EZ

6. When you have the row with entity_type_id = 5 then you can modify increment_prefix and increment_last_id values in it. Delete value in increment_prefix (this will remove leading 1) and set increment_last_id to whatever you want. I'd recommend you to set the new value not lower than part without "10000000", e.g. if it was 100000007 - set it to 7.

Should look like this: http://screencast.com/t/oTdIn6NIhPU

7. Now go back to table eav_entity_type, find the same row with entity_type_id = 5 and set increment_pad_length = 1 (this will remove zeros 0000000).

Should look like this: http://screencast.com/t/Wn6roL6Agd

8. Try to place a new order and check what ID it will have.

Should look like this: http://screencast.com/t/g7lxt8Szs5

 

Let me know how it goes. Likes and kudos are very welcome :-)

 

P.S. You can play around with numbers in increment_pad_length (number of 0000000) and increment_prefix (leading digit) to make the order ID look exactly how you want. Just make sure you have a database backup ;-)

-------Store Manager for Magento 1.x and 2.x - enhances the functionality of default admin web interface, speeds up inventory management, automates daily tasks.

Re: Can I change the starting order number?

Thanks for the recommendation! There are several extensions...why didn't I look a little more?

Re: Can I change the starting order number?

Another aproach, thanks. I may give it a go. Been slowed up by this gotcha: USING THE MAGENTO BACKUP TOOL TOOK DOWN MY SITE. I'm not the first. See https://community.magento.com/t5/Technical-Issues/Magento-1-9-2-error-with-backup-tool-site-now-not-... Seems like a unfair trap for the innocent to me. 

 

Re: Can I change the starting order number?

One thing to keep in mind, the first digit in the order number is the store id, if you have multiple stores it's a good way to keep track of which store the order came from. If you only have one store then this won't be an issue, but if multiple store might be launched in the future then keeping the first didgit in the order id is a good idea.

 

e.g 

 

10000001 comes from one store

20000123 comes from another store

Re: Can I change the starting order number?

Thanks, this worked great and was easy enough for me to do. All I wanted was to get rid of a few of those zeros. I went ahead and did the same ith the invoice, credit memo & shipment forms too.  Thanks to everybody who replied. 

Re: Can I change the starting order number?

This worked great on my 1.9.2.4 site. Thanks

Re: Can I change the starting order number?

Thanks alot its working