Checkout Fields – Postcode always after state
-
I am trying to create a filter to change the order of the Billing Fields. I have got it mostly working, however, no matter where I place ‘billing_postcode’ the field is always next to the state field.
Is there any way to decouple the postcode field from the state field?
This is what I am using:
function custom_woocommerce_checkout_fields( $fields ) { $order = array( "billing_state", "billing_first_name", "billing_last_name", "billing_address_1", "billing_address_2", "billing_postcode", "billing_city", "billing_country", ); foreach ($order as $field) { $ordered_fields[$field] = $fields["billing"][$field]; } $fields["billing"] = $ordered_fields; return $fields; } add_filter( 'woocommerce_checkout_fields' , 'custom_woocommerce_checkout_fields' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Checkout Fields – Postcode always after state’ is closed to new replies.