Magento 2.3.5-p1
I've added the following:
<?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>
in <vendor>/<theme>/etc/di.xml
Order number length is not changing
Am I wrong in assuming that this changes the length of order #?
Solved! Go to Solution.
I've read every one of them that exists.
See my OP.
Am I placing di.xml in the correct place?
Am I running bin/magento setup:di:compile afterwards? (which I've been doing)
Edit:
This can't be overridden in a theme directory (see OP)
I had to create a module --> app/code/vendor/modulename/
Inside of that module, I had to put di.xml --> app/code/vendor/modulename/etc/di.xml
Please check if below share article can help:
https://webkul.com/blog/how-to-change-magento-2-orders-increment-id-pad-length/
https://magento.stackexchange.com/questions/212130/how-to-shorten-the-id-order
To change the padding for the order number you have to override default constant
DEFAULT_PATTERN
which is set in: /vendor/magento/module-sales-sequence/Model/Sequence.php
, on line 19. We can change this in a custom module by creating
etc/di.xml
with the following content:
<type name="Magento\Framework\DB\Sequence\SequenceInterface">
<arguments>
<argument name="pattern" xsi:type="string">%s%'.06d%s</argument>
</arguments>
</type>
You can read more details from here... https://www.classyllama.com/blog/m2-incrementid
okay, can you check below shared one, it is good article:
https://www.classyllama.com/blog/m2-incrementid It might solve your problem
I've read every one of them that exists.
See my OP.
Am I placing di.xml in the correct place?
Am I running bin/magento setup:di:compile afterwards? (which I've been doing)
Edit:
This can't be overridden in a theme directory (see OP)
I had to create a module --> app/code/vendor/modulename/
Inside of that module, I had to put di.xml --> app/code/vendor/modulename/etc/di.xml
Is this di.xml not calling?
If not have you checked your module enabled?
Please try to run by following command:
php bin/magento setup:upgrade php bin/magento c:f