Skip to content

Instantly share code, notes, and snippets.

@molzieyy
Created October 3, 2019 08:53
Show Gist options
  • Save molzieyy/5283fb2d3fa5ee7d560f9d20390612e4 to your computer and use it in GitHub Desktop.
Save molzieyy/5283fb2d3fa5ee7d560f9d20390612e4 to your computer and use it in GitHub Desktop.
<?php
/*Open up the wp-content/themes/themeXXXXX/includes/custom-function.php file.
*You may need to download it to your local system if you are using FTP,
*or you can access the file directly through your hosting file manager.
* Scroll down to the very end of the file and add the following code there:
*
*
*
*
*/
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
//These are fields that you can unset
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['order']['order_comments']);
unset($fields['billing']['billing_email']);
unset($fields['account']['account_username']);
unset($fields['account']['account_password']);
unset($fields['account']['account_password-2']);
return $fields;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment