I found that I should add a row class to the postcode and city to get this done.
I have this code:
function custom_override_checkout_fields( $fields ) {
$fields[‘city’] = array(
‘label’ => __(‘Town / City’, ‘woocommerce’),
‘placeholder’ => _x(‘Town / City’, ‘woocommerce’),
‘required’ => true,
‘class’ => array(‘form-row-first’)
),
$fields[‘postcode’] = array(
‘label’ => __(‘Postcode / Zip’, ‘woocommerce’),
‘placeholder’ => _x(‘Postcode / Zip’, ‘woocommerce’),
‘required’ => true,
‘class’ => array(‘form-row-last’);
return $fields;
}
I’ve put this in my functions.php but the site breaks. How do I get this working properly?
I also have the following code just above it
add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’ );
function custom_override_checkout_fields( $fields ) {
unset($fields[‘billing’][‘billing_address_2’]);
unset($fields[‘billing’][‘billing_company’]);
unset($fields[‘shipping’][‘shipping_address_2’]);
unset($fields[‘shipping’][‘shipping_company’]);
}