Unfortunately, there is no direct option available in the lite version of our plugin to achieve your requirement.
However, as a workaround, you can use the below code by adding it in your child theme’s functions.php file. Which will help you to completely modify the error message.
add_filter('woocommerce_checkout_required_field_notice', 'thwcfd_change_field_label_error', 10, 2);
function thwcfd_change_field_label_error($error_msg, $label){
if($label === 'label of the field'){
$error_msg = 'Required error msg';
}
return $error_msg;
}
In the above code, please replace label of the field with your corresponding field label and the Required error msg with your corresponding error message.
Please note that this code will not work for default email, postcode, state fields.
Thank you.
Hello,
thank you for your kind reply. I tried with the following code:
add_filter('woocommerce_checkout_required_field_notice', 'thwcfd_change_field_label_error', 10, 2);
function thwcfd_change_field_label_error($error_msg, $label){
if($label === 'Dichiaro di aver letto l\'<a href="https://cantinamingazzini.it/privacy-policy/" style="color: #000000">Informativa sulla Privacy</a>.'){
$error_msg = 'Leggi e accetta l\'informativa sulla privacy per procedere con l'ordine.';
}
return $error_msg;
}
but didn’t work… am I missing something?
Thank you
-
This reply was modified 3 years, 2 months ago by
Simo2606.
Your issue needs a detailed check. Can you please raise a ticket through our website? We hope our technical team will be able to help you.
Thank you!
Your support team solved the problem! Thank you!