Join our new community forum for support & discussion

Join Now

Home Support Extensions Reviews First Name not asked while registering.

First Name not asked while registering.

  • Author
    Posts
  • mjda

    Hi there,
    I’m setting up a local listing site using Hivepress and have an issue while implementing the review extension. I configured the settings to show only the Firstname as user display name but, as the name fields aren’t asked while signing up, the comment is published (or waiting for approval) with the username (based on the email in this case) without any possibility to change this (except manually).

    The new registered user isn’t asked anytime to complete his profile and, even if he does, the review displaying name isn’t updated by the Firstname (according to my setting).

    Can you please tell me if there is a way to ask for the firstname directly in the sign-up form in order to avoid unwanted usernames to show up (most users don’t want their last name or strange email address showing up publicly).

    Also, do you know if this issue will be occurring when I’ll (soon) implement the Social Login extension ?

    Best regards !

    ihor developer

    Sorry, there’s no such option at the moment, adding the first & last name fields to the registration form would require code tweaks, but we’ll consider adding it. If you use the Social Login extension this depends on the login methods you enable, for example first & last name will be fetched automatically for Facebook, Google methods so this issue will not occur.

    yevhen developer

    We found a simple code snippet for this, please try this one to add the first and last name fields to the registration form:

    add_action(
    	'hivepress/v1/models/user/register',
    	function( $user_id, $values ) {
    		if(isset($values['first_name'], $values['last_name'])){
    			update_user_meta($user_id, 'first_name', $values['first_name']);
    			update_user_meta($user_id, 'last_name', $values['last_name']);
    		}
    	},
    	10, 
    	2
    );
    
    add_filter(
    	'hivepress/v1/forms/user_register',
    	function ( $args, $form ) {
    		$args['fields'] = array_merge($args['fields'], [
    			'first_name' => [
    				'label' => 'First Name',
    				'type'    => 'text',
    				'required' => true,
    				'_order' => 1,
    			],
    			
    			'last_name' => [
    				'label' => 'Last Name',
    				'type'    => 'text',
    				'required' => true,
    				'_order' => 2,
    			],
    			
    		]);
    
    		return $args;
    	},
    	10,
    	2
    );
    lybpiano

    I had the same issue. I have my own login/registration form on my website which includes the first and last name information. It also tells users to check email for activation.

    Is there a way to redirect users to the URL of my own form instead of using the hivepress form when they are trying to submit a listing for the first time?

    ihor developer

    Sorry, there’s no simple code snippet for this because there are many links in HivePress and extensions to the built-in registration modal. It may be possible with a custom JS script that catches the #user_login_modal URL and redirects it. You can also consider the suggested code snippet to add the first & last name fields to the HivePress form.

    mjda

    Hi thank you for your replies.

    I added your custom code snippet into a custom plugin and it works like a charm on the registration form.

    But when a user leaves a review, the comment is still published (or waiting for approval) with the username (based on the email in this case) even if I set the display name for “First Name” in Hive Press Users settings.

    Furthermore, the user doesn’t have any possibility to change this himself and it can only be done manually by the admin.

    Can you help me setting the First Name as the display name for user reviews ?

    Best regards

    ihor developer

    If you selected First Name as the user display name in HivePress settings please try re-saving any of the user profiles, this setting is used only when the user profile is updated. So all new users (and existing users if they re-save the profile settings) will get their first name as the display name.

    namtrandpm

    I have this problem too. Is there any way to have the user profile update without the user pressing the update button? Users won’t know to press the update button and they will see this as a technical issue.

    ihor developer

    Users don’t have to do anything (e.g. re-update the profile details) if you set the initial name settings in HivePress/Settings/Users and Vendors sections, vendor name will be in sync with the user profile. If you mean auto-saving the user profile form there’s no such feature, saving changes requires clicking the Save Changes button.

Viewing 9 posts - 1 through 9 (of 9 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.