Last active
November 9, 2016 14:29
-
-
Save moskalukigor/9ea3963aa38d81b46a8289cb418ce029 to your computer and use it in GitHub Desktop.
Remove Fields from Checkout Page v2
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", "order_fields"); | |
function order_fields($fields) { | |
//Show only fields: fname,lname | |
$order = array( | |
"billing_first_name", | |
"billing_last_name", | |
); | |
foreach($order as $field) | |
{ | |
$ordered_fields[$field] = $fields["billing"][$field]; | |
} | |
$fields["billing"] = $ordered_fields; | |
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