Apr 18, 2013
kalpesh

Change default length of Increment ID for orders, invoices, shipments, creditmemos

By default in Magento CE 1.6, the default Increment ID of orders, invoices, shipments and creditmemos is 9 characters. If you want to make it short or long due to some other application dependency or whatever you will have to change the value of increment_pad_length in eav_entity_type table.

For changing it with some setup script installer, this code will do the trick:

1
2
$entityType = Mage::getModel('eav/entity_type')->loadByCode('order'); //invoice, shipment, creditmemo
$entityType->setIncrementPadLength(12)->save(); //changing length to 12

For changing it directly in database table, execute this queries:

1
2
3
4
UPDATE `eav_entity_type` SET `increment_pad_length`= 12 WHERE entity_type_code = 'order';
UPDATE `eav_entity_type` SET `increment_pad_length`= 12 WHERE entity_type_code = 'invoice';
UPDATE `eav_entity_type` SET `increment_pad_length`= 12 WHERE entity_type_code = 'shipment';
UPDATE `eav_entity_type` SET `increment_pad_length`= 12 WHERE entity_type_code = 'creditmemo';

2 Comments

  • To change default magento numbers I tried to use several ready-made solutions ( i’m not a developer) and amasty’s Custom Order Number is the best i see on the market. Try to use if needed.

  • Thanks for useful post.
    There is still another way to tackle this issue.
    I suggest using an extension, which can set up the new invoice number and modify the number of the next order at ease, you can check it out at: https://goo.gl/457QUH for more features.

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions