This topic has 2 replies, 2 voices, and was last updated 1 years, 7 months ago ago by Rose Tyler
I am trying to validate each of the checkout fields, but I still get the general error message “Please fill out all required fields.” I cleared the cache, so this is excluded.
I added this code in the functions.php of the child theme:
add_action(‘woocommerce_checkout_process’, ‘my_custom_checkout_field_process’);
function my_custom_checkout_field_process() {
// Check if set, if its not set add an error.
if ( strlen($_POST[‘billing_first_name’])<2 )
wc_add_notice( __( 'Please enter a full name first.' ), 'error' );
}
But I guess that the general message has priority because it is a client side validation. Can you tell me in which file is this validation done so I can overwrite it? I also tried to translate this string but I was not able to find it in the translations files of woocommerce, xstore core, xstore theme.
Thanks,
Mircea
Hello Mircea,
Thank you for contacting us and for using XStore.
Please try to test how it works with the default WooCommerce theme – Storefront activated on your site.
We suppose this is independent of the theme and you need to contact WooCommerce support – https://wordpress.org/support/plugin/woocommerce/
We hope this information is helpful.
Kind Regards,
8theme team
Tagged: checkout, fields, validation, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up