• Resolved justbishwash

    (@justbishwash)


    I have a website where my visitor will buy product without creating account. We dont need to send any email or invoice to them..Just purchase from the site. So i want to hide email field from guest checkout. I am using wp latest release 6.7.1. There is no option to hide email in checkout page.

    • This topic was modified 1 year, 4 months ago by justbishwash.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Saif

    (@babylon1999)

    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!

    Thread Starter justbishwash

    (@justbishwash)

    I tried this but also email field is showing in checkout field while doing guest checkout. I am using Big Store theme.

    Saif

    (@babylon1999)

    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.

    Thread Starter justbishwash

    (@justbishwash)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to hide email field in guest checkout?’ is closed to new replies.