Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Phone Validation by Country and Format

Magento 2 Extension Hyvä Ready Magento 2.4.x

SKU: CUSTOMERPHONEVALIDATION1

  • check format and prefix per shipping country
  • unify entries and store them in international format
  • clear error message at the field, editable per store view
  • applies to checkout, registration, address book and admin orders
Auf Lager
€79.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

6 features

Magento 2 Phone Validation: clean numbers at the moment of entry

Mironsoft Phone Number Validation brings Magento 2 phone validation to your checkout, registration form and address book. The module checks length, country code and format per country, converts the entry into one consistent format and shows a clear message right at the field when something is wrong. Nothing is saved until the number makes sense. Magento 2 phone validation runs on Alpine.js in the Hyvä theme without any extra library, and you set the rules per store view in the admin.

Format per country

Every shipping country has its own lengths and prefixes; the module checks each number against the rules of the selected country.

Normalisation

Spaces, brackets, hyphens and leading zeros are removed and the number is stored in one international format.

Message at the field

Errors appear directly below the input, in the language of the store view and without reloading the page.

Checkout and account

The same check applies at checkout, in customer registration, in the address book and for orders created in the admin.

Required or optional

Decide per store view whether the phone field is mandatory and whether an empty entry is still allowed.

Admin report

A list shows how many numbers were corrected or rejected, which helps you fine-tune the rules.

Why check phone numbers

Why Magento 2 phone validation pays off

A courier calls, nobody picks up, the parcel goes back. Very often the number has a typo, a missing prefix or letters in it. By default Magento only checks that the phone field is filled in, not whether the content is a usable number. Merchants therefore search for Magento 2 phone validation, Magento 2 phone number format or Magento 2 phone field required.

With Magento 2 phone validation you catch these mistakes while the customer is still looking at the form. That saves support questions, prevents failed deliveries and leaves your team with numbers they can actually call.

01Country rules

Magento 2 phone validation with rules for every shipping country

The check follows the country of the address. Germany, Austria and Switzerland use different lengths than France or Poland, and area codes are written in different ways. If the customer changes the country, the field is checked again. For countries without a stored rule you can choose a looser check or let the entry pass. You can also decide whether mobile and landline numbers are both allowed.

  • Length and prefix per country, rules editable in the admin
  • Fresh check when the country in the form changes
  • Countries without a rule: loose check or pass-through
Stores › Configuration › Mironsoft › Phone Number Validation
Country
Germany (example)
Allowed
Landline and mobile
Country without rule
digits and length only
Input › Result
Input (example)
0171 123 45 67
Stored (example)
+491711234567
Display
+49 171 1234567
02Normalisation

Unify the phone number and store it in E.164 format

Customers type 0171 1234567, +49 171 1234567 or (0171) 123 45 67. The module converts every variant into one notation, optionally the international format with a plus sign and country code. The display in the account stays readable while the cleaned number is stored. That helps your shipping software hand numbers over to carriers without anybody correcting them by hand.

  • Removes spaces, brackets and hyphens
  • Replaces a leading zero with the country code
  • Storage format selectable: international or national
03Messages

Error messages customers actually understand

Instead of a generic error, Magento 2 phone validation says what is wrong: number too short, letters included, prefix does not match the selected country. You maintain the texts per store view in the admin. The message appears when the customer leaves the field and again on submit. On a smartphone the numeric keypad opens, and the order button stays disabled until the entry is correct.

  • Own texts per store view and language
  • Check on blur and on submit
  • Numeric keypad on smartphones
Frontend · Checkout › Phone
Field
012 (example)
Message
The number is too short for Germany.
Status
Continue disabled
Admin › Phone Number Validation › Report
Rejected (example)
12 this week
Converted (example)
148 this week
Clean existing data
console command
04Control

Where the check runs and what the admin sees

You decide in which areas the validation runs: checkout, registration, address book, admin orders. Existing customer numbers stay untouched; a console command, if you wish, cleans the existing data in one pass. The admin report shows rejected and converted entries per country so you can see where the rules are too strict or too loose.

  • Each area can be switched on or off
  • Console command to clean existing data
  • Report of rejected entries per country
Use cases

Where Magento 2 phone validation helps in daily shop work

Situations where Magento 2 phone validation saves money and nerves.

Parcel delivery

Drivers and freight carriers need a number they can reach. Checked and uniform numbers reduce failed deliveries and follow-up calls.

Scheduled delivery and assembly

Anyone offering delivery windows or assembly calls the customer first. A wrong number makes the appointment worthless.

International shops

When you ship to several countries, the right rule applies per country and you do not maintain scripts of your own.

Cleaning old customer data

The console command unifies existing numbers before you use them for SMS notifications or shipping software.

Comparison

Magento 2 phone validation: without and with the module

The difference to the default phone field.

TopicWithout the moduleWith Mironsoft Phone Number Validation
CheckRequired field only, any string is acceptedLength and prefix checked per country
NotationMixed, depending on the customerUniform in the chosen storage format
Error messageGeneric hint or noneConcrete text per store view
Existing dataHas to be cleaned by handConsole command for the whole base
ReportingNoneRejections and conversions per country in the admin
Setup

How we set up Magento 2 phone validation for you

The process after you place your order.

1

Briefing

We clarify shipping countries, required-field rules and the storage format you prefer.

2

Installation

We install the module and set up Magento 2 phone validation for your store views, including checkout and address book.

3

Texts

We store the error messages in all shop languages and adjust the tone to your brand.

4

Test

We test Magento 2 phone validation with numbers from every shipping country, mobile numbers, special characters and the switch of country inside the form.

5

Handover

Your team gets an introduction to country rules, the report and cleaning of existing data.

Delimitation

Delimitation from postcode validation and address modules

The Mironsoft postcode validation checks postcodes and their match with the city. This module only handles phone numbers: length, prefix and notation. The two complement each other in the address form because Magento 2 phone validation and postcode validation work on different fields.

All modules can be combined. The interface runs on Alpine.js in the Hyvä theme without jQuery or Knockout. Whether a phone number counts as personal data in your case is for you as the shop operator to assess.

05How the purchase works

No download, but personal setup

Phone Number Validation is not listed here as a ready-made download for self-installation. The purchase is a commission: after the order we get in touch, install the module in your shop and agree country rules, storage format and error texts together with you.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Everything about country rules, format, cleaning existing data and how the purchase works.

How can I set up Magento 2 phone validation?
With Magento 2 phone validation the module checks every entry against the rules of the selected country, converts it into a uniform format and shows an error message at the field.
How can I make the phone field required in Magento 2?
In the admin you decide per store view whether the phone field is mandatory. The module additionally checks that the number is valid, not only that something was typed.
Which format is stored?
You choose between the international format with plus sign and country code and a national notation. The display in the account stays easy to read.
Does the check work for every country?
Rules are stored for the most common shipping countries. For other countries you choose whether only digits and length are checked or whether the entry passes.
How can I clean existing phone numbers in Magento 2?
A console command unifies the existing data in one run. Numbers that cannot be converted unambiguously are listed instead of being changed.
Are numbers sent to external services?
No. The check runs locally in your shop using the stored rules, no third party is queried. The legal assessment remains with you.
Does Magento 2 phone validation work with Hyvä?
Yes, the check is built with Alpine.js and needs no additional library.
Are orders created in the admin checked?
If you want, yes. You switch the admin order area on or off separately.
How is this different from postcode validation?
Postcode validation checks the postcode and city, this module checks the phone number. You can use both together.
Can I download and install the module myself?
No. This offer is not a download product. After the purchase we install and configure the module personally in your shop.
Write Your Own Review
You're reviewing: Magento 2 Phone Validation – Mironsoft Phone Number Validation
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 Phone Validation – Mironsoft Phone Number Validation

Magento 2 Phone Validation – Mironsoft Phone Number Validation

€79.00