1. Home
  2. Help Center
  3. WooCommerce
  4. Customization
  5. Reorder Checkout fields

WooCommerce has a ‘priority’ parameter for each billing and shipping field.

In this example State and City are moved so that the final order will be Country / State / City / Address / Postcode

add_filter( 'woocommerce_default_address_fields', 'goya_custom_reorder_checkout_fields' );
 
function goya_custom_reorder_checkout_fields( $fields ) {
 
   // default priorities:
   // 'first_name' - 10
   // 'last_name' - 20
   // 'company' - 30
   // 'country' - 40
   // 'address_1' - 50
   // 'address_2' - 60
   // 'city' - 70
   // 'state' - 80
   // 'postcode' - 90
 
  // e.g. change order to: Country / State / City / Address / Postcode
  $fields['state']['priority'] = 41;
  $fields['city']['priority'] = 42;
 
  return $fields;
}Code language: PHP (php)

Follow the example to change any field to the desired position.

Paste the snippet to /wp-content/themes/goya-child/functions.php

Don’t modify the original theme files or your changes will be lost on the next update.

Was this article helpful?

Related Articles