cancel
Showing results for 
Search instead for 
Did you mean: 

2.3.5-p1 - Change Order # padding length

SOLVED

2.3.5-p1 - Change Order # padding length

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 #?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: 2.3.5-p1 - Change Order # padding length

@Manish Mittal-

 

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

 

 

 

View solution in original post

7 REPLIES 7

Re: 2.3.5-p1 - Change Order # padding length

@aglasser1 

 

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

Manish Mittal
https://www.manishmittal.com/

Re: 2.3.5-p1 - Change Order # padding length

@Manish Mittal-

 

I've done 50 variations of this already.

Re: 2.3.5-p1 - Change Order # padding length

@aglasser1 

 

okay, can you check below shared one, it is good article:

https://www.classyllama.com/blog/m2-incrementid It might solve your problem

Manish Mittal
https://www.manishmittal.com/

Re: 2.3.5-p1 - Change Order # padding length

@Manish Mittal-

 

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

 

 

 

Re: 2.3.5-p1 - Change Order # padding length

@aglasser1 

 

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
Manish Mittal
https://www.manishmittal.com/

Re: 2.3.5-p1 - Change Order # padding length

@Manish Mittal-

 

See "EDIT:" of last post.

Re: 2.3.5-p1 - Change Order # padding length

@aglasser1 

 

Okay cool! 

Manish Mittal
https://www.manishmittal.com/