I see WooCommerce gives an error message (You must accept our Terms & Conditions.), if someone not checked the "terms" check box (in the checkout page).
How I change/edit the error message?
To edit the location of the checkout errors you must do the following: Set SCRIPT_DEBUG constant to true, do it in the wp-config. php file define('SCRIPT_DEBUG', true); Locate the checkout. js script in the woocommerce/assets/js/frontend Locate wc_checkout_form.
From the dashboard menu, click on the Appearance Menu > Theme Editor Menu. When the theme editor page is opened, look for the theme functions file with the extension functions. php. Open this functions file to add the function to show only one error message for the WooCommerce checkout field.
All you need to do is install a plugin like YITH WooCommerce Tab Manager and activate it. Once active, use the plugin options to remove, change or delete the WooCommerce tabs. You can even create your custom tab. The benefit of using this method is that is the most simple and the most beginner-friendly.
You can do this with the woocommerce_add_error filter. Add the following to your functions.php file.
// alter the subscriptions error
function my_woocommerce_add_error( $error ) {
if( 'The generic error message' == $error ) {
$error = 'The shiny brand new error message';
}
return $error;
}
add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With