-
AuthorPosts
-
September 10, 2017 at 3:01 pm #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?September 10, 2017 at 9:51 pm #850223September 11, 2017 at 8:45 am #850381I 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}?September 11, 2017 at 3:57 pm #850560Hi,
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,
YigitSeptember 11, 2017 at 9:15 pm #850672It 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)September 12, 2017 at 10:56 am #850939Hi 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.phpIf you need further assistance please let us know.
Best regards,
Victoria- This reply was modified 7 years, 3 months ago by Victoria.
-
AuthorPosts
- You must be logged in to reply to this topic.