Created
March 24, 2017 22:00
-
-
Save max-bulygin/baada95678e53298f22fbf9bee059cd7 to your computer and use it in GitHub Desktop.
WooCommerce custom fields order
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
| add_filter("woocommerce_checkout_fields", "order_fields"); | |
| function order_fields($fields) { | |
| $order = array( | |
| "billing_first_name", | |
| "billing_last_name", | |
| "billing_company", | |
| "billing_address_1", | |
| "billing_address_2", | |
| "billing_postcode", | |
| "billing_country", | |
| "billing_email", | |
| "billing_phone" | |
| ); | |
| foreach($order as $field) | |
| { | |
| $ordered_fields[$field] = $fields["billing"][$field]; | |
| } | |
| $fields["billing"] = $ordered_fields; | |
| return $fields; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment