Archived topic
Editing Woocommerce Checkout page
5 replies · Started by Neil on February 5, 2018
Hi,
I'm trying to find a way to remove the mandatory phone number on the WC checkout. Before I look into plugins or trying to edit the code, I wondered if there is anything in GP that allows me to do this.
Neil.
Hi there,
No unfortunately there isn't.
Maybe give this a shot: https://gist.github.com/cryptexvinci/60413e92d6305e27559a1828b14d5490
If not I'd contact WooCommerce support before looking for a plugin solution or edit the code - they should be able to help you out :)
Thanks Leo, I'll take a look.
No problem :)
For future reference (or if anyone else is looking to do the same), I used the following code snippet to make the phone number optional instead of mandatory.
add_filter( 'woocommerce_billing_fields' , 'custom_optional_woo_checkout_phone' );
function custom_optional_woo_checkout_phone( $address_fields ) {
$address_fields['billing_phone']['required'] = false;
return $address_fields;
}
Thanks for sharing :)