Let’s initiate a discussion!!
If you want to remove all leading zero’s from order, invoice and shipment number in Magento 2 then follow below steps
Step 1: Create Registration
Create registration.php file in the app/code/Magemonkeys/Ordersequence folder with the following code.
1 2 3 4 5 6 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Magemonkeys_Ordersequence', __DIR__ ); |
Step 2: Create a module
Create a module.xml file in the app/code/Magemonkeys/Ordersequence/etc folder with the following code.
1 2 3 4 5 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magemonkeys_Ordersequence" setup_version="1.0.0"></module> </config> |
Step 3: Create a di
Create a di.xml file in the app/code/Magemonkeys/Ordersequence/etc folder with the following code.
1 2 3 4 5 6 7 8 |
<?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%'.06d%s</argument> </arguments> </type> </config> |
Step 4 : After place above code, please run below mentioned commands
1 2 3 4 5 |
- php bin/magento setup:upgrade - php bin/magento setup:static-content:deploy - php bin/magento cache:clean |
That’s it.
Now refresh your admin order page and see that leading zero’s should be removed.
[crayon-641fb8e6b03ef850741102/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
We will create a new category page layout and use...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.