Site logo

Archived topic

Editing Woocommerce Checkout page

5 replies · Started by Neil on February 5, 2018

Viewing posts 1–6 of 6

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.

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 :)

This archived topic is closed to new replies.