Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created August 21, 2019 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/a46d352c8287dd158866e860965056c8 to your computer and use it in GitHub Desktop.
Save clifgriffin/a46d352c8287dd158866e860965056c8 to your computer and use it in GitHub Desktop.
How to reorder address fields for Checkout for WooCommerce.
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
add_action( 'woocommerce_default_address_fields', 'cfw_reorder_address_fields', 100000 + 10 );
function cfw_reorder_address_fields( $fields ) {
$fields['city']['priority'] = 50;
$fields['city']['columns'] = 4;
$fields['state']['priority'] = 60;
$fields['state']['columns'] = 12;
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment