Last active
August 29, 2018 09:35
-
-
Save sandeshjangam/098325699f92c598d642e7e592f221b9 to your computer and use it in GitHub Desktop.
Remove WooCommerce checkout page fields - sandeshjangam.com
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 | |
/* This Code Will Removes "company", "address1" & "address2" Checkout Fields */ | |
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields' ); | |
function custom_remove_checkout_fields( $fields ) { | |
/* Billing Field */ | |
unset( $fields['billing']['billing_company'] ); | |
unset( $fields['billing']['billing_address_1'] ); | |
unset( $fields['billing']['billing_address_2'] ); | |
return $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 | |
/* This Code Will Removes All Billing & Additional Checkout Fields */ | |
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields' ); | |
function custom_remove_checkout_fields( $fields ) { | |
/* Billing Field */ | |
unset( $fields['billing']['billing_first_name'] ); | |
unset( $fields['billing']['billing_last_name'] ); | |
unset( $fields['billing']['billing_company'] ); | |
unset( $fields['billing']['billing_address_1'] ); | |
unset( $fields['billing']['billing_address_2'] ); | |
unset( $fields['billing']['billing_city'] ); | |
unset( $fields['billing']['billing_postcode'] ); | |
unset( $fields['billing']['billing_country'] ); | |
unset( $fields['billing']['billing_state'] ); | |
unset( $fields['billing']['billing_phone'] ); | |
unset( $fields['billing']['billing_email'] ); | |
/* Additional Filed */ | |
unset( $fields['order']['order_comments'] ); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment