Created
June 16, 2016 06:49
-
-
Save xadapter/ab7a6789d270b214dc04ad0a645613fc to your computer and use it in GitHub Desktop.
WooCommerce - Unset the required property of fields on checkout page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_checkout_fields' , 'xa_checkout_change_required_fields_to_optional' ); | |
function xa_checkout_change_required_fields_to_optional( $fields ) { | |
$fields['billing']['billing_address_1']['required'] = false; | |
$fields['billing']['billing_address_2']['required'] = false; | |
$fields['billing']['billing_postcode']['required'] = false; | |
$fields['billing']['billing_city']['required'] = false; | |
$fields['billing']['billing_phone']['required'] = false; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment