I want to shorten order number (increment id) but I don't want to use any modules.
Magento – Custom Order Number or Increment ID
increment-idmagento-1.7orders
increment-idmagento-1.7orders
I want to shorten order number (increment id) but I don't want to use any modules.
Best Answer
To reduce the number of digits, you'll want to modify the
increment_pad_length
in theeav_entity_type
table (for theorder
row, of course).You can change the prefix by modifying the
increment_prefix
value in theeav_entity_store
table. (Use theentity_type_id
from the other table to identify which row you'd change.) By default, Magento uses the store's id (1
) as the prefix.If you're interested in learning more about the increment IDs, check out the
Mage_Eav_Model_Entity_Increment_Numeric
andMage_Eav_Model_Entity_Increment_Abstract
classes which are responsible for generating the next available ID based on the database settings.Edit: You could even create your own increment logic by extending the Abstract class I mentioned above.