-
-
Save brunoalvarenga/cd7bc42439df93ae08e2a1803564592b to your computer and use it in GitHub Desktop.
WooCommerce - Remove billing address, fone and company 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 | |
/** | |
* 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