Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 102129

oriye on "[Plugin: WooCommerce - excelling eCommerce] Woocommerce checkout fields width"

$
0
0

Hello,
I am working with a Japanese website. I arranged the order of the checkout fields with something I found one of the posts:

add_filter('woocommerce_checkout_fields','reorder_woo_fields');

function reorder_woo_fields($fields) {
//move these around in the order you'd like

$fields2['billing']['billing_last_name'] = $fields['billing']['billing_last_name'];
$fields2['billing']['billing_first_name'] = $fields['billing']['billing_first_name'];
$fields2['billing']['billing_company'] = $fields['billing']['billing_company'];
$fields2['billing']['billing_address_1'] = $fields['billing'][billing_address_1''];
$fields2['billing']['billing_address_2'] = $fields['billing']['billing_address_2'];
$fields2['billing']['billing_city'] = $fields['billing']['billing_city'];
$fields2['billing']['billing_postcode'] = $fields['billing']['billing_postcode'];
$fields2['billing']['billing_country'] = $fields['billing']['billing_country'];
$fields2['billing']['billing_state'] = $fields['billing']['billing_state'];
$fields2['billing']['billing_email'] = $fields['billing']['billing_email'];
$fields2['billing']['billing_phone'] = $fields['billing']['billing_phone'];

//just copying these (keeps the standard order)
$fields2['shipping'] = $fields['shipping'];
$fields2['account'] = $fields['account'];
$fields2['order'] = $fields['order'];

return $fields2;
}

The Japanese method follows a reversed order, so I changed above to:

add_filter('woocommerce_checkout_fields','reorder_woo_fields');

function reorder_woo_fields($fields) {
//move these around in the order you'd like

$fields2['billing']['billing_last_name'] = $fields['billing']['billing_last_name'];

$fields2['billing']['billing_first_name'] = $fields['billing']['billing_first_name'];

$fields2['billing']['billing_postcode'] = $fields['billing']['billing_postcode'];

$fields2['billing']['billing_state'] = $fields['billing']['billing_state'];

$fields2['billing']['billing_city'] = $fields['billing']['billing_city'];

$fields2['billing']['billing_address_1'] = $fields['billing']['billing_address_1'];

$fields2['billing']['billing_address_2'] = $fields['billing']['billing_address_2'];

$fields2['billing']['billing_email'] = $fields['billing']['billing_email'];

$fields2['billing']['billing_phone'] = $fields['billing']['billing_phone'];

//just copying these (keeps the standard order)
$fields2['shipping'] = $fields['shipping'];
$fields2['account'] = $fields['account'];
$fields2['order'] = $fields['order'];

return $fields2;
}

I was able to rearrange but some fields overlapped, and the fields are not aligned to its ideal position.

The rows now per line show as:
last name
first name, postal code
town/city, state
(Address field overlapping or postal code field)
Address 2,
Email, Phone

Thank you in advance for any help.

http://wordpress.org/extend/plugins/woocommerce/


Viewing all articles
Browse latest Browse all 102129

Trending Articles