Created
April 21, 2015 19:50
-
-
Save neltseng/f4278b249cbebd3c1985 to your computer and use it in GitHub Desktop.
WooCommerce Checkout Field 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
// WooCommerce 自訂結帳欄位排序 | |
add_filter('woocommerce_default_address_fields', 'cwp_custom_address_fields'); | |
function cwp_custom_address_fields($fields) { | |
// 依照需要的欄位調整順序 | |
$fields2['country'] = $fields['country']; | |
$fields2['first_name'] = $fields['first_name']; | |
$fields2['last_name'] = $fields['last_name']; | |
$fields2['company'] = $fields['company']; | |
$fields2['address_1'] = $fields['address_1']; | |
$fields2['address_2'] = $fields['address_2']; | |
$fields2['city'] = $fields['city']; | |
$fields2['state'] = $fields['state']; | |
$fields2['postcode'] = $fields['postcode']; | |
$fields2['email'] = $fields['email']; | |
$fields2['phone'] = $fields['phone']; | |
return $fields2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment