User roles for searchers and hotel owners

This topic contains 5 replies, has 2 voices, and was last updated by  Paolo 8 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #68342

    squashed_pixel
    Buyer
    Post count: 26

    Hey

    Does GD have any sort of functionality to have different user profiles for the my account section.

    At present if a user signs up for an account the my account section shows them a section for invoicing and to add listings. This would only be applicable for anyone who has added a hotel, which most people will have not.

    Ideally how we would like it to work is in the my account section, if a user has added any hotels, they see the invoicing information etc, if they have not added a hotel they see some generic account page information and links to their favourites etc, is this possible??

    Many Thanks

    Ben

    #68400

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    not without a customization of the code.

    Thanks

    #68501

    squashed_pixel
    Buyer
    Post count: 26

    Hey,

    Is there a way to return the number of hotels associated with a particular user account ?? e.g. $user->hotels??

    Cheers

    #68812

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    it is not that simple…

    1st of all where do you want to add that?

    A function like this would do it for the currently logged in user for example, assuming hotels for you are the CPT gd_hotel:

    
    
    global $wpdb;
    $ptype = 'gd_hotel';
    $user_id = get_current_user_id();
    $total_posts = $wpdb->get_var("SELECT count( ID )
               FROM " . $wpdb->prefix . "posts
               WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' )");

    It really depends what you are trying to do and on which page.

    Thanks

    #69161

    squashed_pixel
    Buyer
    Post count: 26

    Hey

    Thanks for coming back to me. I would be trying to do this on the front end my account page. What i was thinking is basically have an if statement to say: If the current users numbers of hotels is greater than 0, then show the invoicing etc, if they don’t ( meaning they have 0 hotels ) then show them their favorites, etc.

    Cheers

    #69228

    Paolo
    Site Admin
    Post count: 31206

    That should get you started, let us know how you went.

    Thanks

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket