// Limit Woocommerce phone field to 11 digits number

add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process');

  

function my_custom_checkout_field_process() {

    global $woocommerce;

  

    // Check if set, if its not set add an error. This one is only requite for companies

    if ( ! (preg_match('/^[0-9]{11}$/D', $_POST['billing_phone'] ))){

        wc_add_notice( "Incorrect Phone Number! Please enter valid 11 digits phone number"  ,'error' );

    }

}