Move the Email Field to the Top of Checkout
Puts the billing email field first on the classic checkout so you capture the address early, which also helps abandoned cart tools.
Opens WPIDE on
Code
add_filter( 'woocommerce_billing_fields', function ( $fields ) {
if ( isset( $fields['billing_email'] ) ) {
$fields['billing_email']['priority'] = 1;
$fields['billing_email']['class'] = array( 'form-row-wide' );
}
return $fields;
}, 20 );
Notes
Only affects the classic checkout shortcode. The block checkout already asks for the email first.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.