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:
$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:
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
Leave a comment
Welcome to my Blog
Certifications
Honor
Recognition
Contributions
Categories
- Apache (2)
- ChatGPT (1)
- Domain name (2)
- eCommerce (2)
- htaccess (1)
- Humor (3)
- Instagram API (1)
- jQuery (4)
- JSON (1)
- Linux (10)
- Magento (142)
- Magento admin (58)
- Magento Certification (5)
- Magento error (13)
- Magento frontend (68)
- Magento Imagine (2)
- Magento Interview (5)
- Magento Master (2)
- Magento2 (10)
- Mobile (1)
- MySQL (7)
- OpenAI (1)
- OroCRM (2)
- Performance (2)
- PHP (8)
- Prototype JS (3)
- Security (4)
- Wordpress (3)
- XML (2)
Tag Cloud
500 internal server error admin answers attribute bug category checkbox checkout cookie customer difference domain name EAV error event extension interview invoice jquery linux magento magento2 magento admin magento error magento interview questions magento orm mysql observer order pinterest product products questions redirect register remove script session simplexml to array state status study guide tax url wordpress
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.