• function custom_checkout_fields( $address_fields ) {
    unset( $address_fields[‘billing’][‘billing_email’] );
    return $address_fields;
    }
    add_filter( ‘woocommerce_checkout_fields’, ‘custom_checkout_fields’ ,20, 1 );

    I have written this function to make email filed option which work perfectly on desktop but for mobile its not working

    • This topic was modified 3 years, 10 months ago by amandotline.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter amandotline

    (@amandotline)

    Its little urjent can anyone help me out

    Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    The code above does two things:

    • Removed the email address field entirely;
    • Applies to both desktop/mobile – the PHP code on WooCommerce for that field doesn’t distinguish between devices

    If that field is hidden on desktop but not on mobile, it’s likely that the field is being added through a custom template override from your theme and that this is set to be shown using media queries in CSS.

    Thread Starter amandotline

    (@amandotline)

    hello it is hidden in mobile also but when i am filling the form and checking instamojo payment getaway then i m getting a error that “filed is required” and that is email field only but for desktop it is working fine only for mobile i have problem

    Plugin Support RK a11n

    (@riaanknoetze)

    Are you getting the same error message on mobile when using a different payment gateway (e.g. BACS or COD) as a test? If everything works with BACS or COD but not instamojo, then you’d need to get in touch with their support team to take a closer look into things.

    Thread Starter amandotline

    (@amandotline)

    I have made email address as optional on checkout form but when i am doing my payment through instamojo or razorpay its telling “this field may not be blank” both on desktop and mobile

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘make email field optional for checkout form’ is closed to new replies.