• Resolved gentle2309

    (@gentle2309)


    hi , i would to display first name or last name in woocommerce dashboard instead of name of user email, please look at the example below :

    it takes automatically the name of Email not first or last name .

    “Hello john_55 (not John_55? Log out)”

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @gentle2309,

    That’s a great idea. The account page is set up to show the “display name” by default. That’s a WordPress core feature and can be set by editing the user’s profile on the backend of the site.

    You may be able to use a PHP snippet to force the display of the first name if it’s available. I haven’t tested it, but there is a snippet here that may do this for you.

    https://gist.github.com/tobedoit/4146888

    Another option would be to use a template override and change this with your theme. The file you need to override is /templates/myaccount/dashboard.php. On line 30, change this:

    
    '<strong>' . esc_html( $current_user->display_name ) . '</strong>',
    

    to be like this:

    
    '<strong>' . esc_html( $current_user->first_name ) . '</strong>',
    

    On my test site that replaces the display name with the first name that’s saved on the user’s account.

    I hope that gets you pointed in the right direction.

    Cheers

    Hello @gentle2309,

    It’s been a while since we heard back from you about this. I’m going to mark this thread resolved. If you still need help, please open up a new topic and we’ll be happy to help out.

    Take care

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display first name or last name in woocommerce dashboard instead of email user’ is closed to new replies.