Real-time Format Validation
Smart Phone Field checks that the number is valid for the selected country before the order is placed. If it isn’t, a clear message appears next to the field, such as too short, and the order can’t go through until it’s fixed.
What counts as valid#
- The right length and pattern for the selected country.
- Landlines and mobiles are both accepted.
When the check runs#
- When the customer leaves the field.
- When they place the order. The first invalid phone field is focused so they can fix it.
Turning it off#
Go to WooCommerce > Smart Phone Field > General and turn off Check phone numbers. Customers can then enter any number. It is still saved in international format.
In code, use the nahnu_spf_validate_number filter:
add_filter( 'nahnu_spf_validate_number', '__return_false' ); The same check also runs on your server, so it can’t be skipped. See Server-side Validation.
