Title: State now appears after zipcode?
Last modified: March 3, 2020

---

# State now appears after zipcode?

 *  Resolved [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * (@darrylhadfield)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/)
 * I’ve taken on a gut/upgrade job with a customer. Oddly, in both the staging environment
   as well as the prod environment, all orders – both from before and after the 
   upgrade – have swapped the Zipcode such that addresses in orders now read:
 * Fistname Lastname
    1234 Streetname City Zipcode State
 * Rather than the more expected:
 * Fistname Lastname
    1234 Streetname City State Zipcode
 * Why would this occur?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [cedcommerce](https://wordpress.org/support/users/cedcommerce/)
 * (@cedcommerce)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12501889)
 * Hello [@darrylhadfield](https://wordpress.org/support/users/darrylhadfield/) ,
 * In order to change the position of the fields, you have to change the priority
   of the fields accordingly.
 * i.e,
 * billing_first_name 10,
    billing_last_name 20, billing_company 30, .. and so on
   each field is differentiated by the difference of 10
 * Change the priority that particular filed change it’s position.
 * like this,
 *     ```
       add_filter( 'woocommerce_default_address_fields', 'ced_reorder_checkout_fields' );
   
       function ced_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. move 'company' above 'first_name':
         // just assign priority less than 10
         $fields['company']['priority'] = 8;
   
         return $fields;
       }
       ```
   
 * Thanks,
 *  Thread Starter [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * (@darrylhadfield)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12503469)
 * a) Would that go into wp-config, or another file?
    b) I’m a little concerned 
   about adding code as the likelihood of that being overridden in the next update
   due to file copy activity. Is this not something that is configurable within 
   WC?
 * last.. thank you very much – Even if I have to manually add the filter to code,
   it achieves the desired end result.
 *  [cedcommerce](https://wordpress.org/support/users/cedcommerce/)
 * (@cedcommerce)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12503788)
 * Hello,
 * No not in config file, you need to put this in active theme’s functions.php
 * No keep it in child theme or it will not wave off, with the update of woo.
 * Thanks,
 *  Thread Starter [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * (@darrylhadfield)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12504011)
 * Thank you -that would suggest then that a theme update would likely overwrite,
   causing the same issue. Still a better option than current, although I wish WooCommerce
   had this configurable as an option rather than having to modify other WordPress
   components.
 *  Thread Starter [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * (@darrylhadfield)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12504057)
 * I apologize, reading your code again shows that the default is the expected visibility
   in the order viewing area that my customer (the store proprietor) sees.
 * Customers checking out will see fields arrayed in the order per the default, 
   but the oddly shown address (zipcode before state) is when the proprietor views
   the orders in the control panel.
 * That’s what I’m trying to correct, as he uses that as a simple copy/paste for
   label purposes.
 *  Plugin Support [slash1andy](https://wordpress.org/support/users/slash1andy/)
 * (@slash1andy)
 * Automattic Happiness Engineer
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12508242)
 * Hey there!
 * The address on both places should not show like you are saying it does (for US
   addresses). If it is showing with the zip before state, there’s likely a customization
   somewhere on your site that is changing that. I would recommend doing a conflict
   testing (disabling all other plugins, changing themes to default twentytwenty)
   to figure out if that’s it.
 *  Thread Starter [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * (@darrylhadfield)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12511998)
 * Good point; thank you very much. Found the problematic plugin and sent them feedback.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘State now appears after zipcode?’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [darrylhadfield](https://wordpress.org/support/users/darrylhadfield/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/state-now-appears-after-zipcode/#post-12511998)
 * Status: resolved