is there really no way to remove the Email field from new checkout?? #50676
noshaad
started this conversation in
Checkout Flow
Replies: 1 comment 1 reply
-
Hey! Email is hardcoded into the Checkout process and there's no standard way to remove it for now. You can hide the email from Checkout form using this code: wc_enqueue_js('wcSettings.defaultFields.email.required = false; wcSettings.defaultFields.email.hidden = true;'); You need to provide an email at backend (at processing time) and remove it at place order time, or hack your way around |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use this code:
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_email']);
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields', 1000, 1 );
it didn't work
also this code didn't work!! isthere a way at all to remove Email??
add_filter( 'woocommerce_form_field' , 'remove_checkout_required_asterisk_field', 10, 4 );
function remove_checkout_required_asterisk_field( $field, $key, $args, $value ) {
// Only on checkout page and billing email field
if( is_checkout() && ! is_wc_endpoint_url() && $key === 'billing_email' ) {
$required = ' *';
$field = str_replace( $required, '', $field );
}
return $field;
}
Beta Was this translation helpful? Give feedback.
All reactions