From 09748a01ca0929088e92ab358555498fa7089c93 Mon Sep 17 00:00:00 2001 From: yevheniifedorus <yevheniifedorus@gmail.com> Date: Wed, 9 Dec 2020 15:01:40 +0200 Subject: [PATCH] validation chechout --- ajax.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ajax.php b/ajax.php index de219f3..38270ae 100644 --- a/ajax.php +++ b/ajax.php @@ -55,12 +55,14 @@ function go_to_thank_you() { function validate_fname_lname(){ - $fields = WC()->checkout->get_checkout_fields(); - $errors = new WP_Error(); + return true; - if ( preg_match( '/\\d/', $fields[ 'billing_first_name' ] ) || preg_match( '/\\d/', $fields[ 'billing_last_name' ] ) ){ - $errors->add( 'validation', 'Your first or last name contains a number. Really?' ); - } +// $fields = WC()->checkout->get_checkout_fields(); +// $errors = new WP_Error(); +// +// if ( preg_match( '/\\d/', $fields[ 'billing_first_name' ] ) || preg_match( '/\\d/', $fields[ 'billing_last_name' ] ) ){ +// $errors->add( 'validation', 'Your first or last name contains a number. Really?' ); +// } } -- GitLab