Skip to content

Instantly share code, notes, and snippets.

@asharirfan
Last active August 30, 2016 15:47
Show Gist options
  • Save asharirfan/24d3feacbbef1588be0d1cc88986ff3a to your computer and use it in GitHub Desktop.
Save asharirfan/24d3feacbbef1588be0d1cc88986ff3a to your computer and use it in GitHub Desktop.
Function to override the checkout fields of WooCommerce.
<?php
/**
* Function to override the checkout fields of WooCommerce.
*
*/
if ( ! function_exists( 'override_woocommerce_checkout_fields' ) ) {
function override_woocommerce_checkout_fields( $fields ) {
unset( $fields[ 'billing' ][ 'billing_country' ] );
unset( $fields[ 'billing' ][ 'billing_address_2' ] );
unset( $fields[ 'billing' ][ 'billing_state' ] );
unset( $fields[ 'billing' ][ 'billing_postcode' ] );
unset( $fields[ 'order' ][ 'order_comments' ] );
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'override_woocommerce_checkout_fields' );
}
@asharirfan
Copy link
Author

asharirfan commented Aug 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment