Could you please try adding the below style in your theme’s Additional CSS and verify it from your side?
.form-row-last {
float: right;
width: 48%;
}
.form-row-first {
float: left;
width: 48%;
}
We hope this will help.
Thank you!
Hi, thanks, we’re almost there… It seems that some fields are still displayed incorrectly -> https://imgur.com/a/NmnWiLJ
We have checked and the issue is due to an update in WooCommerce recent version (4.4.1).
From the WooCommerce 4.4.1, WooCommerce replaces “form-row-first”, “form-row-last” & “form-row-wide” classes from address field with the available class from field locale class (Additional code in woocommerce/assets/js/frontend/address-i18n.js, line number 109, 110,111 & 112).
This change affect the address field like billing_address_1, billing_address_2, billing_city, billing_state, billing_postcode, shipping_address_1, shipping_address_2, shipping_city, shipping_state & shipping_postcode.
We already find the solution and we will fix this in the upcoming version of our plugin.
If you need an urgent fix, kindly request you use the below code snippet in your child theme’s functions.php file. You have to modify the class name in the given code snippet as per your requirement. Also, you need to comment on the line that not required.
// define the woocommerce_get_country_locale_default callback
function th45r_filter_woocommerce_get_country_locale_default( $default_address_fields ) {
if(!is_checkout()){
return $default_address_fields;
}
$default_address_fields['address_1']['class'] = array('form-row-first', 'address-field');
$default_address_fields['address_2']['class'] = array('form-row-last', 'address-field');
$default_address_fields['city']['class'] = array('form-row-first', 'address-field');
$default_address_fields['state']['class'] = array('form-row-last', 'address-field');
$default_address_fields['postcode']['class'] = array('form-row-first', 'address-field');
return $default_address_fields;
};
// add the filter
add_filter( 'woocommerce_get_country_locale_default', 'th45r_filter_woocommerce_get_country_locale_default', 10, 1 );
We hope this will help.
Thank you!
Hi,
The provided code doesn’t work, it messes up the layout. And am I correct that it’s nog fixed in the latest release? I’m using the latest version of the plugin on almost all of my webshops and none of them show the 2 fields per row correct anymore.
Cheers,
Jaap
Waiting for this error to be updated. Thanks guys!!
We have released a new version of our plugin (lite version) in which we have provided an option “Enable class override for address fields” in the Advanced settings tab.
Please enable it and verify it from your side.
We hope this will help.
Thank you!