• Resolved cmht

    (@eightsages)


    Hi everyone!

    How do I hide the email address field in customer’s My Account -> Addresses -> Billing Address ?

    I want Woocommerce to use the email address entered under Account Details as the billing address.

    (I have already hidden the email address field in the billing details of the checkout page – thanks @mohitmishra!)

    Many thanks in advance

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • @eightsages You can use the below code to remove the email field

    /**
    * This function is used for the removing the email field
    * 
    * @param array $address Array of the address
    * @param string $load_address
    * @since 1.0.0
    * @author Mohit Mishra
    * @link https://makewebbetter.com
    */
    function mwb_remove_the_address_field( $address, $load_address ) {
    	unset( $address['billing']['billing_email'] );
    	return $address;
    }
    add_filter( 'woocommerce_address_to_edit', 'mwb_remove_the_address_field', 10, 2 );
    Thread Starter cmht

    (@eightsages)

    Hi Mohit, thanks for this !

    Unfortunately this doesn’t seem to have any effect.

    The email address field is still there (https://prnt.sc/qyty5n).

    I used this in the child theme functions.php file. Should I have put it elsewhere ?

    Appreciate your help ??

    Ohh I am sorry @eightsages Try with this new code this will work fine

    /**
    * This function is used for the removing the email field
    * 
    * @param array $address Array of the address
    * @param string $load_address
    * @since 1.0.0
    * @author Mohit Mishra
    * @link https://makewebbetter.com
    */
    function mwb_remove_the_address_field( $address, $load_address ) {
    	unset( $address['billing_email'] );
    	return $address;
    }
    add_filter( 'woocommerce_address_to_edit', 'mwb_remove_the_address_field', 10, 2 );
    Thread Starter cmht

    (@eightsages)

    Awesome, thanks so much !

    Might contact you separately some day for a larger custom project ??

    Cheers

    Chris

    Thanks, @eightsages You can connect me on the skype if you want.Here is the id of the skype live:mohitmishra_6

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide email field in My Account -> Addresses – > Billing Address’ is closed to new replies.