Created
April 7, 2018 04:46
-
-
Save luizbills/3068bec6a413b9425a70110ac2ca558f to your computer and use it in GitHub Desktop.
custom checkout fields
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_checkout_fields' , 'lpb_override_checkout_fields', 20 ); | |
| function lpb_override_checkout_fields ( $fields ) { | |
| // remove o campo "sexo" | |
| unset( $fields['billing']['billing_sex'] ); | |
| // remove obrigatoriedade do campo "data de nascimento" | |
| if ( isset( $fields['billing']['billing_birthdate'] ) ) { | |
| $fields['billing']['billing_birthdate']['required'] = false; | |
| } | |
| return $fields; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment