Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created January 27, 2016 02:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save claudiosanches/590bf8e9e5d9dd0ba104 to your computer and use it in GitHub Desktop.
Save claudiosanches/590bf8e9e5d9dd0ba104 to your computer and use it in GitHub Desktop.
WooCommerce - Remove billing address, fone and company fields
<?php
/**
* Plugin Name: WooCommerce Remove billing fields
* Description: Remove billing address, fone and company fields from WooCommerce checkout.
* Author: Claudio Sanches
* Author URI: https://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
function cs_woocommerce_remote_billing_fields( $fields ) {
unset( $fields['billing_phone'] );
unset( $fields['billing_address_1'] );
unset( $fields['billing_address_2'] );
unset( $fields['billing_city'] );
unset( $fields['billing_postcode'] );
unset( $fields['billing_state'] );
unset( $fields['billing_country'] );
unset( $fields['billing_company'] );
$fields['billing_email']['class'] = array( 'form-row-wide' );
return $fields;
}
add_filter( 'woocommerce_billing_fields', 'cs_woocommerce_remote_billing_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment