Created
November 9, 2016 13:07
-
-
Save moskalukigor/76c342c5e8b1d566b2392d1aca4b8c44 to your computer and use it in GitHub Desktop.
Remove Fields from checkout page
This file contains 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
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields', 10, 1 ); | |
function custom_override_checkout_fields( $fields ) { | |
$fields['billing']['billing_phone']['required'] = false; | |
unset($fields['billing']['billing_phone']['validate']); | |
$fields['billing']['billing_country']['required'] = false; | |
unset($fields['billing']['billing_country']['validate']); | |
unset($fields['billing']['billing_country']); | |
$fields['billing']['billing_state']['required'] = false; | |
unset($fields['billing']['billing_state']['validate']); | |
$fields['billing']['account_password']['required'] = false; | |
unset($fields['billing']['account_password']['validate']); | |
return $fields; | |
} | |
/* | |
Billing | |
billing_first_name | |
billing_last_name | |
billing_company | |
billing_address_1 | |
billing_address_2 | |
billing_city | |
billing_postcode | |
billing_country | |
billing_state | |
billing_email | |
billing_phone | |
Shipping | |
shipping_first_name | |
shipping_last_name | |
shipping_company | |
shipping_address_1 | |
shipping_address_2 | |
shipping_city | |
shipping_postcode | |
shipping_country | |
shipping_state | |
Account | |
account_username | |
account_password | |
account_password-2 | |
Order | |
order_comments | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment