Hello @justbishwash!
The following snippet should do it, but I advise against doing this unless you have a compelling reason, as your payment gateway and other systems may require the email address to assess fraud and other potential issues.
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
if ( !is_user_logged_in() ) {
unset($fields['billing']['billing_email']);
}
return $fields;
}
You can either add it to the bottom of your child theme’s functions.php file or use a plugin like Code Snippets.
Cheers!
I tried this but also email field is showing in checkout field while doing guest checkout. I am using Big Store theme.
I tried this but also email field is showing in checkout field while doing guest checkout. I am using Big Store theme.
I just tested it and it’s working fine. I don’t think your theme is the problem, but if your cart and checkout pages are block-based, then this is expected.
To confirm, simply edit both the cart and checkout pages and replace the blocks with the default [woocommerce_cart] and [woocommerce_checkout] shortcodes.
Thank You @babylon1999 . After adding shortcode and removing block its working. Thanks a lot ❤️
Hi @justbishwash,
You’re very welcome! I’m glad to hear that it’s working now. I’ll go ahead and mark the thread as resolved. If you need further assistance, feel free to reach out anytime.