Address fields are controlled by the WC_Countries class and can be filtered via:
$address_fields = apply_filters( 'woocommerce_' . $type . 'fields', $address_fields, $country );
where there are 2 $types: billing and shipping. Once you’ve found that it is just PHP array manipulation:
function reorder_shipping_fields( $address_fields ){
if ( isset( $address_fields['shipping_company'] ) ){
$shipping_company = $address_fields['shipping_company'];
unset( $address_fields['shipping_company'] );
$address_fields['shipping_company'] = $shipping_company;
}
return $address_fields;
}
add_filter( 'woocommerce_shipping_fields', 'reorder_shipping_fields' );
Related Posts:
- “Custom Post Type Permalinks” plugin URL strcuture
- register_activation_hook in oop approach
- Can free plugin on WordPress.org site promote pro-version of this plugin?
- Add script into front from my plugin
- Meta box losing its value when scheduled post is published
- Make thumbnails on product-category pages the same size [WooCommerce] [closed]
- how to change automatic placing of social plugins below content?
- Multisite for Multisite?
- Disable Plugin with one button
- Exact Hook to payment methods
- Are mu-plugins plugins still deployed via wordpress.org/plugins?
- How to make my blog available to other website using RSS feed?
- Basic function call on init failing
- WordPress programming video tutorials [closed]
- WordPress front end AJAX. Return 0 :?
- Display a consistent Google Plus icon on ALL pages of my site
- breadcrumb need to show all pages and subpages
- WordPress 5.4 – How to prevent to enter only certain values in custom field
- DB Query not working in Plugin
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- Woocommerce Free shipping method [closed]
- Is there a way to remove plugins in dashboard – where you cannot identify the slug by the plugins name?
- Mutliple users editing single document in wordspress
- Blocking Plugin Css to load custom in template directory
- Plugin: connect to external database without showing password
- Woocommerce: Set thumbnail detail (clipping area)
- How can I create custom in-post templates?
- Filtered content appears in the excerpt
- unregister a sidebar widget
- How to disable Wp-PageNavi at the top of the page
- Why aren’t my Follow Me links working?
- Could add_query_arg() redirect user to external site?
- Plugins to generate reflinks in WordPress
- How to make if statement in react plugin?
- Use a hook or filter, or overwrite this Gamipress function?
- Hook from plugin doesn’t fire up from external PHP script
- Custom User Registration Form not showing
- SMTP emails not picking up the correct From name and From email
- What database state changes happen after a post is manually “updated” with no changes?
- Display posts by alphabetical order
- save_post hook partly firing in update post
- Wp-cron.php firing too many times , even disabled in wordpress wp-config.php,
- custom fields not displaying on wordpress site
- Overriding a function in a WordPress plugin
- Get Shortcode output to database for static post_content
- Show post object of any page in frontend
- after logout session not destroy from server/website side
- strtotime not working
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- How To Toggle User_Meta in frontend in a form using PHP
- How to update a database entry with a wordpress plugin?
- Change Woo Custom Endpoint Titles from a Plugin
- WP Job Manager Feature jobs from [job_dashboard] page [closed]
- White blank screen while adding or editing pages in wordpress
- Speeding up WordPress on a Local Network
- How can I store user preferences in WordPress and retreive them later?
- Get only selected custom taxonomy
- how change my menu on submenu
- Using slightly modified widget
- Plugin debugging with errors in activation routine
- WordPress update plugin through Dashboard/Plugins displaying error
- DB Sync Media Files extension [closed]
- Alter add_meta_box
- Authenticating custom field on login
- WP internationalization not loaded
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- How to get rid of error message of custom metabox in dashboard when moving out of edit page?
- Adding custom cron_schedule prior to wp_schedule_event
- Create plugin with form in post and submit it to specific form
- Is it right way to create shortcode?
- Storing values in Post Meta vs new tables
- Capturing POST data
- Translate Woosidebars plugin strings
- How to add different CSS for galleries
- How do I add php to all links automatically?
- WP-PostRatings – how to make rating show up?
- Making plugin to use different table prefix cause permission problem
- Auto play audio using WP Maintenance Mode Plugin [closed]
- Plugin to allow for recurrent subscription + exclusive content
- How to automatically convert “normal” conditions to yoda conditions
- Woocommerce Large Variations Shows Out of Stock Items [closed]
- Why my site loads too Slow? [closed]
- Plugin Links to page not working
- woocommerce how to get cat id in content-product.php
- How to use WP-reCAPTCHA on a form
- How should I force WordPress to give proper name for the uploading images?
- plugin how to find code and edit it in a template file?
- How to create a “plugin” or “block” that can manipulate WordPress DOM in frontend?
- How to rename files during upload to a random string?
- Redirecting to page on form submit – Revue plugin
- Create WordPress category dynamically
- Plugin Icon does not work correctly
- Adding “Changelog” as a second tab to the auto updater custom plugin
- wp db request without refreshing the page
- REST API – filters not working inside plugin class
- Advanced Custom Fields (ACF) and their Javascript API
- Simple ajax request with Vanilla JS keeps given 400 Bad Request
- WORDPRESS ,Can’t load image of post when sharing post via facebook [closed]
- rest_cannot_update error
- How can I rename roles in a WordPress multisite installation?