International phone and postcode validation in Magento 2: what Checkout Validation checks

3 min read

Silver handset and envelope beside blank form fields with orange brackets and navy separators under a magnifier

In cross-border sales, a customer may enter a plausible phone number or postcode and have the form reject it. Compare local notation with the deployed validator’s rule first. This guide describes Kowal Checkout Validation’s concrete limits so acceptance does not stop at one Polish address.

Phone: character checks rather than full number verification

In the reviewed module 1.0.3, a phone value can contain digits and an optional leading plus. The test example +442079460000 passes this rule, while +44 20 7946 0000 fails because of spaces. The probe used an example range identified by Ofcom, without making calls.

The rule does not check length, agreement between the prefix and address country, or assignment to a subscriber. Even a single digit can pass the character check alone. Do not call this confirmation of contactability. If you need formatting normalization or country-specific length rules, define and test that scope separately.

Postcode: five dedicated patterns

The table shows acceptance examples for the module’s current version, not address-existence checks. Patterns are defined for Poland, Germany, Czechia, Slovakia, and the US. An additional rule blocks whitespace in postcodes.

CountryPasses module rulesDoes not pass
Poland00-00100001
Germany1011510-115
Czechia11000110 00
Slovakia81101811 01
United States10001; 10001-123410001 1234

Separate local notation from implementation scope

Rejecting spaces does not mean every local spaced notation is wrong. Czech Post describes a space in printed postcodes, while this module accepts five compact digits. If you want to accept both, plan a change or normalization and verify the format passed to the carrier.

For a country without a dedicated pattern, an absence of spaces does not confirm postcode validity. The function probe for France even accepted ABCDE. British SW1A 1AA is blocked by its space, while compact SW1A1AA passes without a dedicated British-format check. This is an implementation boundary, not a claim of all-country support.

Distinguish form blocking from server diagnostics

The frontend can block nonconforming values in the supported form. Backend checks run in log-only mode and do not stop saving through this check. A blank field passing a format helper can still be required by another rule. Do not infer the entire validation behavior from one message.

A probe of unmodified frontend functions with synthetic data covered 21 scenarios and confirmed these behaviors. It did not test production checkout, phone availability, or parcel deliverability. Module diagnostics record the rule, country, and value length, among other fields, without the customer’s full value.

Add international examples to acceptance

For each market, test accepted and rejected notation, country switching, and saved and new addresses. Link the probe to the country–customer–address matrix. Accept the frontend, saved order, and integration handoff separately. Do not automatically strip separators from all fields without agreeing on the destination format.

Country; field; sample test format; expected acceptance or blocking; actual rule; frontend outcome; saved outcome; integration format; owner.

Kowal Checkout Validation helps detect specific input errors. The earlier guide covers general acceptance of invalid values. Add the international set to that review and update it when expanding markets or changing carrier requirements.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)