Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #850118

    Hi,
    I’m using the enfold theme to build a shop.
    Currently the salutation on the my account page says “Hello {username}”.
    Is there a way to change it to “Hello {first name}”?
    I noticed that new shop customers get there “Display name publicity” set to {username}.
    I didn’t find were to change that to {first name} by default.
    I tried this plugin https://wordpress.org/plugins/force-first-last/ but when I register a new customer it stills says “Hello {username}”.
    Do you know how to change it to “Hello {first name}” by default?

    #850223

    Hey tl_s180,
    Go to your profile and add a nickname, then you will have the display name option
    2017-09-10_154718

    Best regards,
    Mike

    #850381

    I see the option “Display name publicity” for existing shop customers.
    By default it is set to {username} and if I change it manually to {first name} the salutation on the my account page looks fine.
    But I don’t want to edit all new customers manually.
    Is there a way to force “Display name publicity” to be {first name} by default or make the my account page select {first name} instead of {username}?

    #850560

    Hi,

    Please try adding following code to Functions.php file in Appearance > Editor

    
    function set_default_display_name( $user_id ) {
      $user = get_userdata( $user_id );
      $name = sprintf( '%s %s', $user->first_name);
      $args = array(
        'ID' => $user_id,
        'display_name' => $name,
        'nickname' => $name
      );
      wp_update_user( $args );
    }
    add_action( 'user_register', 'set_default_display_name' );

    Best regards,
    Yigit

    #850672

    It still says “Hello {username}” :’ (
    I made a test order, registered new customer but still..

    Seems woocommerce changed it in one of the latest updates.
    I’m using woocommerce 3.1.2. Here “Hello {username}” is default
    I have another woocommerce project running on 2.6.13. There it says “Hello {first name}” by default (without code in functions.php)

    #850939

    Hi tl_s180,

    This is more related to WooCommerce than to Enfold, but here is where you can find the code that displays that
    https://cl.ly/3w40251T181i
    https://github.com/woocommerce/woocommerce/blob/master/templates/myaccount/dashboard.php

    If you need further assistance please let us know.
    Best regards,
    Victoria

    • This reply was modified 7 years, 1 month ago by Victoria.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.