Custom checkout error messages for required fields?
-
Hi All,
I was able to make the Notes a required field using the woocommerce_checkout_fields filter, but the generic error message comes up when it’s left blank:
“Order Notes is a required field.”
I would like to replace this with my own custom message, and found this script which I thought would do the trick:
function my_woocommerce_add_error( $error ) { if( 'Order Notes is a required field.' == $error ) { $error = 'The shiny brand new error message'; } return $error; } add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );
No luck – I tried with and without the period in the message. I have several input fields that will need error message customizations as well (like the phone number). Any help would be greatly appreciated.
Thanks,
-Ben
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom checkout error messages for required fields?’ is closed to new replies.