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

  1. Allard says:

    I an a layman, can you tell me where to find functions.php file
    and… how if I want to add 2 textarea custom fields?

  2. Phil says:

    Hi!

    Tks for the code

    How add a date picker ?

    and it must not be modifiable 🙂

    Best

  3. chua says:

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

  4. 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.

  5. 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 );

  6. 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.

  7. bozo says:

    Good code – But how display in the frontend profile ?

  8. 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