Skip to content

Override zip_codes.xml #6694

@luukschakenraad

Description

@luukschakenraad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.1.xThe issue has been fixed in 2.1 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions