In the 10.0.21 release, it is now possible to enforce shopper-entered phone number formatting, using one of two methods:
The existing phone number masking (Configuration - Settings - PhoneNumberMask.Enabled) has been improved to allow the United States and International phone number entry to be modified to provide the best format for your store needs.
A new setting ForcePhoneFormat.Enabled allows for explicit restrictions on the phone number field in the Account and Address pages, preventing a shopper from saving the entry unless they provide a phone number in the correct format.
Configuration - Settings:
If true, phone numbers will be constrained to the format specified by ForcePhoneFormat.Pattern. Please set a value on ForcePhoneFormat.Pattern BEFORE enabling this setting. It is STRONGLY RECOMMENDED that string resource phone.forcedformatinvalid is updated to provide the expected phone format to the shopper if they enter an invalid format.
true / false
If ForcePhoneFormat.Enabled is TRUE, the selected regular expression pattern here will be used to verify the phone format. If the pattern does not match, string resource phone.forcedformatinvalid will be displayed to the shopper. It is STRONGLY RECOMMENDED that string resource phone.forcedformatinvalid is updated to provide the expected phone format to the shopper if they enter an invalid format.
USA DOMESTIC (555) 555-5555 :
USA INTERNATIONAL +1-555-555-5555 :
If true, customer-entered phone numbers will be forced to adhere to a standard format, for example "(000) 000-0000". The PhoneNumberMask.USA setting is used for USA numbers, while PhoneNumberMask.International is used for international numbers. The customer phone number entered on the account page also uses PhoneNumberMask.International.
true / false
If PhoneNumberMask.Enabled setting is true, US phone numbers will adhere to the format specified in this setting. It is recommended to use the default value: (000) 000-0000 XXXXXXXXXX
(000) 000-0000 XXXXXXXXXX
If PhoneNumberMask.Enabled setting is true, International (non-US) phone numbers will adhere to the format specified in this setting. It is recommended to use the default value: XXXXXXXXXXXXXXXXXXXXXXXXX
- To enforce and assist the format of the standard United States 10-digit (aaa) bbb-cccc
PhoneNumberMask.USA (000) 000-0000
PhoneNumberMask.International (000) 000-0000
NOTE: ForcePhoneFormat.Enabled must be FALSE
- To enforce and assist the format of the standard United States 10-digit (aaa) bbb-cccc PLUS allow entry of an Extension number (ex. (123) 456-7890 ext 212):
In the Settings, if you added additional TEXT spaces to the number format, it will look for "ext ####" , but nothing else is allowed. You would use something like this:
(000) 000-0000 XXX XXXX
- "0" are required numerical entries.
- "( -" and other special characters will be added automatically as the customer enters values.
- "XX" are optional entry slots. Though alphas can be entered, ONLY "ext" (or "EXT") and numeric values will be accepted.
- " " Spaces will be automatically added as the customer types entries beyond the space.
NOTE: The Content - Manage Prompts - account.phone.example and address.phone.example should be adjusted to match your format.