Hi,
I have been trying to make the telephone number check out field in WooCommerce not-required. I am still learning about hooks and filters, and I am having trouble understanding which of the following functions to use, and where to put it in the code. I think the first one would remove the billing phone number, and the second one would just make it non-required. Can you please let me know in which file/directory I should place this code, and if there are any brackets, tags, etc that I should next them in?
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields( $fields_array ) {
unset($fields_array['billing_phone']);
return $fields_array;
}
-----
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields( $fields_array ) {
$fields_array['billing_phone']['required'] = false;
return $fields_array;
}
Thanks!














