Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created December 16, 2013 08:36
Show Gist options
  • Save corsonr/7983932 to your computer and use it in GitHub Desktop.
Save corsonr/7983932 to your computer and use it in GitHub Desktop.
WooCommerce: re-order shipping fields
add_filter( 'woocommerce_order_formatted_shipping_address' , 'woo_custom_order_formatted_shipping_address' );
/**
* woo_custom_order_formatted_shipping_address
*
* @access public
* @since 1.0
* @return void
*/
function woo_custom_order_formatted_shipping_address() {
$address = array(
'first_name' => $this->shipping_first_name,
'last_name' => $this->shipping_last_name,
'company' => $this->shipping_company,
'address_1' => $this->shipping_address_1,
'address_2' => $this->shipping_address_2,
'city' => $this->shipping_city,
'state' => $this->shipping_state,
'postcode' => $this->shipping_postcode,
'country' => $this->shipping_country
);
return $address;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment