Last active
October 21, 2017 05:08
-
-
Save nfmohit/fa385f3fdb7104ef30ff7db855a8b13d to your computer and use it in GitHub Desktop.
Making Woocommerce checkout fields optional
This file contains hidden or 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
| <?php | |
| add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' ); | |
| function custom_override_default_address_fields( $address_fields ) { | |
| $address_fields['address_1']['required'] = false; | |
| $address_fields['address_2']['required'] = false; | |
| $address_fields['postcode']['required'] = false; | |
| $address_fields['state']['required'] = false; | |
| $address_fields['city']['required'] = false; | |
| $address_fields['country']['required'] = false; | |
| return $address_fields; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment