Today we will talk about how to Rearrange Checkout Fields in WooCommerce. Before beginning, you should learn that checkout fields in WooCommerce are divided into 4 groups, which are:
Billing – Contains billing addresses
Shipping – Contains billing addresses
Order – Contains order information
Account – Contains order information
Each of these fields contains a priority parameter that decides the field arrangement. The following code will be found in the function.php file of your theme/child theme:
add_filter( 'woocommerce_checkout_fields', 'qaisarsatti_field_Sort' );
function qaisarsatti_field_Sort( $checkoutFields ) {
$checkoutFields[ 'billing' ][ 'billing_email' ][ 'priority' ] = 2;
return $checkoutFields;
}
function qaisarsatti_field_Sort( $checkoutFields ) {
$checkoutFields[ 'billing' ][ 'billing_email' ][ 'priority' ] = 2;
return $checkoutFields;
}
Just change the priority to rearrange the field placement, as I have done in the above example where I have set the email field’s priority to 2.