6 Responses to “How to add user custom field in My Account page in Woocommerce?”

  1. chua says:

    hi tim, u can retrieve the info using the code below:-
    $birthdate = get_user_meta( $user_id, ‘birthdate’, true );

  2. Tim says:

    Very nice, thanks a lot for your work! How could I mention this data in the emails sent by woocommerce? Additionally to all the data that is sent in the emails, I also want the birthdate to be next to the the email adress and the mobile phone number of the customer.

  3. chua says:

    you can load the custom field data using the function below and echo it wherever u like:-
    $birthdate = get_user_meta( $user_id, ‘birthdate’, true );

  4. chua says:

    just duplicate the fieldset content and change the field name to your field name.
    and remember to add in the newly added field name at the my_woocommerce_save_account_details function.

  5. bozo says:

    Good code – But how display in the frontend profile ?

  6. Henry says:

    Great tutorial! How would you add more than one field? Would I need to put all the fields in an array or so? For example. I need address1, address2, state, zip, phone

    Thanks in advance

Leave a Reply