Magento2: Override zip_codes.xml

Created on 21 Sep 2016  路  4Comments  路  Source: magento/magento2

When trying to override module-directory/etc/zip_codes.xml from a local module, only the last code of a country gets included.

Preconditions

  1. Magento 2.1.1

Steps to reproduce

  1. Follow steps as described here
  2. Add this to zip_codes.xml:

<?xml version="1.0"?> <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> <code id="pattern_2" active="true" example="1234AB">^[0-9]{4}[a-zA-Z]{2}$</code> </codes> </zip> </config>

  1. Open checkout-page and enter in console: window.checkoutConfig.postCodes['NL']
  2. Only pattern 2 will be shown.
  3. Paste code from step 2 directly into the core zip_codes.xml. Redo step 3 and you will see pattern_1 and pattern_2
  4. Even when entering 5 patterns in my module's zip_codes.xml file, only the last one is shown. Pasting them in the core zip_codes.xml it works as expected.

Expected result

  1. All patterns should be included on the check-out page.

Actual result

  1. Only the last pattern from Module's zip_codes.xml is shown
Fixed in 2.1.x Format is valid Ready for Work bug report

Most helpful comment

Hi @luukschakenraad. Thank you for your report.
The issue has been fixed in magento/magento2#14117 by @simpleadm in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.14 release.

All 4 comments

Internal ticket created MAGETWO-59258. Thanks for reporting.

The fix is delivered to develop branch. Closing the issue.

@SerhiyShkolyarenko Will Magetwo-59258 be included in 2.1.3?

Hi @luukschakenraad. Thank you for your report.
The issue has been fixed in magento/magento2#14117 by @simpleadm in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.14 release.

Was this page helpful?
0 / 5 - 0 ratings