Phone Numbers

From WHMCS Documentation

WHMCS 7.4 introduced a new way of entering and storing phone numbers.

PhoneNumberInputUx.png

This new input field experience has been designed to simplify the process of entering international phone numbers and make it clearer and easier for users to know how to indicate the country a phone number is located in.

Using a combination of the country prefix and phone number entered, the phone number will be stored in a consistent and uniform format as follows:

+ [Country Code] . [Phone Number]

Configuration

This feature is enabled by default. However it can be disabled if required by unticking the Setup > General Settings > Localisation tab > Phone Numbers checkbox.

When enabled, the client's phone number saved in the database will automatically be prefixed by the international country dialling code. When disabled, this will not be added automatically to the database value, but will still be reflected in the UI.

Automatic Number Formatting

The pre-selected country will default to your WHMCS system default country. The selected country will be automatically updated upon change of the physical address country while-ever the phone number field remains empty.

Users can also begin typing a phone number that begins with a country code in the format "+XX" and upon a valid country code being detected, the selected country will be automatically updated.

Any phone numbers entered into WHMCS prior to the automatic phone number formatting feature will be converted automatically on display within a phone number field. The value stored in the database will not be updated however until the first time the phone number is saved.

Order Forms

The screenshot below demonstrates how the phone number input experience is presented within the default Standard Cart order form.

PhoneNumberOrderForm.png