Last active
January 10, 2018 08:16
-
-
Save paaljoachim/7da8d62b3f46485c33c6620ffeabb091 to your computer and use it in GitHub Desktop.
WooCommerce checkout field adjustments. Removes company, country, address, city, state and postcode. I have commented out the removing of phone and e-mail. I have also removed the additional information box.
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
/* -------- WooCommerce - checkout fields ---------- */ | |
/* From Kathy. */ | |
function kia_modify_default_address_fields( $fields ){ | |
if( isset( $fields['company'] ) ) unset( $fields['company'] ); | |
if( isset( $fields['country'] ) ) unset( $fields['country'] ); | |
if( isset( $fields['address_1'] ) ) unset( $fields['address_1'] ); | |
if( isset( $fields['address_2'] ) ) unset( $fields['address_2'] ); | |
if( isset( $fields['city'] ) ) unset( $fields['city'] ); | |
if( isset( $fields['state'] ) ) unset( $fields['state'] ); | |
if( isset( $fields['postcode'] ) ) unset( $fields['postcode'] ); | |
return $fields; | |
} | |
add_filter( 'woocommerce_default_address_fields', 'kia_modify_default_address_fields' ); | |
function kia_remove_billing_phone_fields( $fields ){ | |
// if( isset( $fields['billing_phone'] ) ) unset( $fields['billing_phone'] ); | |
// if( isset( $fields['billing_email'] ) ) $fields['billing_email']['class'] = array( 'form-row-wide' ); | |
return $fields; | |
} | |
add_filter( 'woocommerce_billing_fields', 'kia_remove_billing_phone_fields' ); | |
// https://businessbloomer.com/woocommerce-remove-order-notes-checkout-page/ | |
// Removes the Additional Information box. | |
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add the above into the child theme functions.php or an external woocommerce code snippet file.