If you want to make Woocommerce billing or shipping field is not required then you just add below function to the function.php file, custom function file or custom child theme function.php In the below example, we’ll edit the Billing Phone field. Add this code to your child theme’s functions.php file.
STEPS TO CHANGE DEFAULT NOTICE TEXT
- Open WordPress admin panel, go to Appearance > Theme Editor
- Open functions.php theme file
- Add the following code at the bottom of function.php file
- Save the changes and check your website. The custom text in add to cart button should show up now.
add_filter( 'woocommerce_billing_fields', 'wc_unrequire_wc_phone_field');
function wc_unrequire_wc_phone_field( $fields ) {
$fields['billing_phone']['required'] = false;
return $fields;
}
you can replace ” billing_phone ” with your desire field that you want to change