I want to remove the four extra padded zeros from the Order id, i.e, Order Id from 000000001 to 00001
2 Answers
In eav_entity_type
table,By default increment id length is 8. So Order Id has 8 0s.
You need to change the length value in eav_entity_type
table.
First run this query
SELECT * FROM eav_entity_type WHERE entity_type_id =5;
entity_type_id 5 mentions sales/order.
By default increment_pad_length
value is 8,you need to change it from 8 to 4 for your need.
change increment_pad_length
value by run this query
UPDATE eav_entity_type SET increment_pad_length = 4 WHERE entity_type_id =5;
I think it will help you..
Create a basic module and put this in the di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\DB\Sequence\SequenceInterface">
<arguments>
<argument name="pattern" xsi:type="string">%s%'.05d%s</argument>
</arguments>
</type>
</config>
The 5 in the argument is the length of the number + padding 0s, ie 00001