So, I run a webstore using Magento which submits our orders to our warehouse for processing. However, our warehouse also takes orders from call ins and fax ins; and all this data needs to be aggregated into a single database. So far, we have been manually entering our data into POSIM (Point of Sale Inventory Maintenance) and been doing just fine with it.
However, one thing that the warehouse staff has been complaining about is the REALLY LONG order numbers that Magento generates that they need to enter into the database. Magento, by default, gives your orders a 9 digit order number – this is just a little overkill. (I don’t suspect doing 100,000,000 sales on my web store for quite some time, if ever!) So I, and the warehouse staff, thought it best to lower that order number from 9 digits long to 5 or 6 digits long. I tried a few different things, and this is what I ended up with after a little Google-fu.
1. Connect to your magento SQL database either via ssh or phpMyAdmin.
2. Run the following SQL query on the Magento database. Please note that the increment_pad_length should be your desired order number length, minus one, because Magento adds a padding number in the front. (So, if you want 10232 to be your starting spot, change the increment_pad_length to 4 instead of 5.)
update `eav_entity_type` set `increment_pad_length`=5 where `entity_type_code`='order' limit 1 ; update `eav_entity_store` set `increment_last_id`='100111' where `entity_store_id`=1 limit 1 ;
Please note, if you are doing this on a live installation and want to keep consistency in your order numbering, the last three digits of the increment_last_id should be the last three digits of your most recent order number!
3. Log in to the Magento Admin Panel and go to System->Cache Managment and clear all the caches.
4. Submit a new order and see the now shortened order number instead of the one a mile long!
ENJOY!
Oh yeah, for those of you who don’t have shell access or access to phpMyAdmin, you could potentially write up a PHP script to do this for you. By going that direction, all you would need to be able to do is FTP the php file to your server. But I won’t cover that right now (Soon though). If you need me to right away, let me know in the comments and I will write a quick post about it.
Links:


