Change order of billing fields on woo-commerce checkout page


We can change fields order based on priority please find below code to change FIELD ORDER

add_filter(“woocommerce_checkout_fields”, “order_fields”);

function order_fields($fields) {

$fields[‘billing’][‘billing_first_name’][‘priority’] = 1;
$fields[‘billing’][‘billing_last_name’][‘priority’] = 2;
$fields[‘billing’][‘billing_company’][‘priority’] = 3;
$fields[‘billing’][‘billing_email’][‘priority’] = 4;
$fields[‘billing’][‘billing_phone’][‘priority’] = 5;
$fields[‘billing’][‘billing_country’][‘priority’] = 6;
$fields[‘billing’][‘billing_address_1’][‘priority’] = 7;
$fields[‘billing’][‘billing_address_2’][‘priority’] = 8;
$fields[‘billing’][‘billing_city’][‘priority’] = 9;
$fields[‘billing’][‘billing_state’][‘priority’] = 10;
$fields[‘billing’][‘billing_postcode’][‘priority’] = 11;

return $fields;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s