I guess i Have found the solution for q2
In functions php of your child theme just add the following code
// Custom validation for Billing Phone checkout field
add_action(‘woocommerce_checkout_process’, ‘custom_validate_billing_phone’);
function custom_validate_billing_phone() {
$is_correct = preg_match(‘/^[0-9]{10}$/’, $_POST[‘billing_phone’]);
if ( $_POST[‘billing_phone’] && !$is_correct) {
wc_add_notice( __( ‘The Phone field should be 10 digits.’ ), ‘error’ );
}
}
First of all, the plugin is awesome! Thank you!
I have the same question as Frankbaku (2)
For Ukraine somehow there is no validation of phone number. So user can enter any quantity of digits and the system will allow it.
Is there any way I could limit the digits that are entered by the user?