User role and category alignment

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

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

Open Support Ticket
  • Author
    Posts
  • #491663

    Nicolas Wuergler
    Expired Member
    Post count: 7

    Hi All,

    Folks who use GeoDirectory on my site register and are thereby assigned one of the following user roles automatically: first_user_role, second_user_role, third_user_role (access to/ restriction of content happens through permissions rules associated with roles). Then, I have a few post types e.g. gp_place and always three corresponding categories first_user_category, second_user_category and third_user_category.

    Now, each user type should only be able to post in his/her category. If the user role changes (upgrade/downgrade of role) the already published posts and any new post should again match the corresponding category (e.g. first_user posts in first_user_category of gp_place, etc.).

    Now, I read https://wpgeodirectory.com/support/topic/set-default-category/ and https://wpgeodirectory.com/support/topic/autofill-category/ which if I understand correctly, should enable automatic selection of category depending on package selection on the add-listing page. This would basically allow me to align a user role to a package and via package to the category, correct? But in my case I actually do not want to have the user select a package, because it is already clear that first_user has first_user_package and thus posts in first_user_category etc. (because here again we have corresponding first_user_package, second_user_package, third_user_package set up). How would the set-default-category code have to be altered anyway?

    <script>
    
    jQuery(document).ready(function(){
        
        if(location.pathname == "/add-listing/")
        {
                jQuery('#gd_placecategory.chosen_select').val('9').change();
                setTimeout(function()
                {
                    jQuery('input[name = post_default_category][value = 9]').attr("checked", "checked");
                }, 2000);
      
        }
    
    });
    
    </script>

    But, instead of going through the extra layer of creating and later selecting a package and based on the package selecting a category and automating this selection via script, couldn’t it be done much simpler using a function whereas first_user_category and first_user_package for all posts always corresponds to first_user_role?

    Thank you for your help!

    #491692

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    those snippets are for V2.

    For help with customizations you can contact a GD Expert here:

    https://geodirectoryexperts.com/

    When the developers have time they will take a look and update GDV2 snippets in some cases. I have flagged your request, but if your need is time sensitive, please contact an independant expert.

    #491756

    Nicolas Wuergler
    Expired Member
    Post count: 7

    Hello Alex,

    Thank you for flagging. Yes, I have Version 2.0.0.62 installed.

    The pricing manager extension allows me to choose which categories are to be displayed on the add-listing page. However, as a default logic, it would make sense that if such a choice results in only one category being displayed/offered no manual selection be necessary or even better one could set a default select manually (ideally even allowing for a dependency on package selection).

    Thanks for your support!

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

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

Open Support Ticket