Your address will show here +12 34 56 78

Home Forums WP ESTATE – Real Estate WordPress Theme FORUM Changing from user to agent

This topic contains 12 replies, has 4 voices, and was last updated by  Anna 2 years, 11 months ago.

  • Author
    Posts
  • #37858

    Raul

    Hello,

    I would like to know how can I convert an user into agent, by just chaging the data in the BD.

    Thanks.

  • #38244

    Raul

    bump?

  • #38247

    Anna
    Keymaster

    Hi Raul,

    Thanks for the bump. Didn’t get the first message.

    A PHP developer will answer this in the next 1-2 days.

    Thank you
    Anna

  • #38440

    Raul

    Thank you Anna.

  • #38740

    crerem

    Hello,
    Unfortunately you cannot do that just by changing something into DB. Agents are a custom post type and they are stored in a different database table than the user.

    I recommend to set the option “Front end registered users should be saved as agents” to yes , delete users and register again in front end.

    thanks

    • This reply was modified 3 years, 5 months ago by  Anna.
  • #38761

    Raul

    Hello Crerem,

    For some reason after tons of modifications that option doesnt work anymore. But I would like to do manually whatever that option does when a user is registered for 1st time.

    Could you please explain me how do you handle the registration of an agent?

    Thanks.

  • #39233

    Anna
    Keymaster

    Hi Raul,

    Sorry for the delay. It’s a busy week for us. Will try to answer these days.

    Thank you,
    Anna

  • #39365

    raul

    Its ok Anna, we are solving others things first but this is a major trouble for us and we need that as soon as you can. We just want to know how an agent is formed so we can register some users as agents and some others as users.

    Thanks

  • #39387

    Anna
    Keymaster

    Hi Raul

    Function is in ajax-login.php line 128

    function wpestate_register_as_user($user_name,$user_id){
    $post = array(
    ‘post_title’ => $user_name,
    ‘post_status’ => ‘publish’,
    ‘post_type’ => ‘estate_agent’ ,
    );

    $post_id = wp_insert_post($post );
    update_post_meta($post_id, ‘user_meda_id’, $user_id);
    update_user_meta( $user_id, ‘user_agent_id’, $post_id) ;
    }

    Thank you
    Anna

  • #39698

    Raul

    Thanks Anna, that worked..

  • #100715

    sanket
    Participant

    How you changed it raul . can you little explain please . i also want to do the same .

    • #100925

      mi000001
      Participant

      Yes, Raul, can you explain for us please? thank you…

      Anna, could this be a future fix in future updates to make users agents and agents users from admin with much more ease? that would be great if you can implement it in future updates.

      Thank you!

  • #100932

    Anna
    Keymaster

    Hi mi000001

    In Admin this option can’t work with YES/NO control. At least that’s what we figured out when we implemented this.

    We will keep an eye open.

    Thanks
    Anna

You must be logged in to reply to this topic.