Magento – How to disable Zip/Postal Code validation Notice Magento 2

magento2validationzipcode

I want to disable this notice in the checkout from Magento:

Provided Zip/Postal Code seems to be invalid. Example: 1234 AB. If you
believe it is the right one you can ignore this notice.

I don't want to get an notice. Just want it to be required.
Can anybody help me how to do that?

I think this is special for Dutch shippingplaces.

Best Answer

Further to the answer by @Trabbie, there is a way to have a local override. The details are on the official docs but in a nutshell, create a custom extension, with a file etc/zip_codes.xml (in fact the docs currently say create etc/zip_code.xml, but that filename is incorrect.)

Then add your changes. However, there is currently a bug that means only the final <code> is used. So in the case of the Netherlands, I had to change my regex so that it made the space optional. My final zip_codes.xml looked like:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd">
    <zip countryCode="NL">
        <codes>
            <code id="pattern_1" active="true" example="1234 AB">^[0-9]{4}\s?[a-zA-Z]{2}$</code>
        </codes>
    </zip>
</config>

PS. I know this isn't strictly hiding the warning as per the question, but it should reduce the chances of it being displayed!

Related Topic