Change order of billing fields on checkout page
-
I’m using the WC filter to order billing fields, and it worked fine before (WC 3.0.3) updating to WooCommerce 3.0.4
It seems the filter works fine, but for unknown reasons it revert back on the fly to the default order.
add_filter("woocommerce_checkout_fields", "custom_order_fields"); function custom_order_fields($fields) { $order = array( "billing_email", "billing_first_name", "billing_last_name", "billing_phone", "billing_address_1", "billing_postcode", "billing_address_2", "billing_country" ); foreach($order as $field) { $ordered_fields[$field] = $fields["billing"][$field]; } $fields["billing"] = $ordered_fields; $fields['billing']['billing_address_1']['placeholder'] = ''; $fields['billing']['billing_address_2']['placeholder'] = ''; $fields['billing']['billing_phone']['placeholder'] = ''; $fields['billing']['billing_address_2']['label'] = __( 'City', 'blank' ); $fields['billing']['billing_phone']['label'] = __( 'Phone number', 'blank' ); return $fields; }
STEPS TO REPRODUCE THE ISSUE
WooCommerce 3.0.4 + code above in the functions.php
- The topic ‘Change order of billing fields on checkout page’ is closed to new replies.