Change WordPress user roles and capabilities Forums How to or FAQ Role for Woocommerce that only allows Order Management & FedEx Package Creation

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #3701
    edering
    Participant

    I’m trying to create a Role called Order where our fulfillment company can only get to Orders in WooCommmerce and fully manage them (status change, notes, etc). We use a WooCommerce Extension from Xadapter called FedEx WooCommerce Shipping with Print Label. This allows the user to Generate Packages (it shows how many boxes and their weight/size) and then generate a FedEx Shipping Label. When I have all WooCommerce abilities set (which I don’t want), I still get denied to Generate Package in this Role. But as an Admin, I can do it. The only custom capabilities listed in URE are URE and WooCommerce (nothing for this extension).

    Also, how do I get a Role to not have access to WooCommerce Settings?

    #3702
    Vladimir
    Keymaster

    WooCommerce->Settings is protected by ‘manage_woocommerce’ capability.
    1) you can revoke it from a role to exclude this menu item from user access;
    or
    2) if you need to leave access to other menu items protected by the same capability (System Status, Extensions), you can use Admin menu access add-on to block this menu item.

    I need access to WooCommerce FedEx plugin in order to check what permissions it requires to print labels. You can send its copy to support [at-sign] role-editor.com
    I install such products at local development environment and use for testing/investigation purpose only.

    #3706
    edering
    Participant

    Thanks. But, when I uncheck manage_woocommerce (https://www.screencast.com/t/TzFy0SJp) and try to login to /wp-admin, the login takes me to the WooCommerce My Account page – https://www.screencast.com/t/hmxEFF2S . I just emailed you the zip of the plugin… thanks

    #3707
    edering
    Participant

    Your mail rejected my email that had the zip file. So I created a Dropbox.com folder for support email address to access it. Here is the folder: [removed]

    #3709
    Vladimir
    Keymaster

    Got a plugin. I will look at it.

    #3710
    Vladimir
    Keymaster

    You can use view_admin_dashboard capability for access to wp-admin with active WooCommerce. Read this article for more details.

    #3711
    edering
    Participant

    Thanks for the article. But do I click Add Capability for Role in URE and add view_admin_dashboard or do I need to add the function for the Admin Dashboard? Or both?

    #3712
    Vladimir
    Keymaster

    Adding new view_admin_dashboard capability is enough. It was added recently. Custom filter is a former method to manage this issue.

    #3713
    edering
    Participant

    I figured out the view_admin_dashboard. I just had to add it, no need to change my functions file. thanks

    #3714
    Vladimir
    Keymaster

    FedEx shiping plugin allows to use ‘Generate Packages’ feature to users with ‘administrator’ or ‘shop_manager’ role only by default. Good news – the plugin offers a custom filter ‘wf_user_permission_roles’ which you can use to add your own role to this predefined list, like this:

    
    add_filter('wf_user_permission_roles', 'wf_user_permission_roles');
    
    function wf_user_permission_roles($roles) {
    
        $roles[] = 'wc-orders-manager';
        
        return $roles;
    }
    
    #3715
    edering
    Participant

    Where does the above go? Functions.php? And, I have two different Roles I need access to this (in addition to my Admin): Manager, Orders

    #3716
    Vladimir
    Keymaster

    Yes, functions.php. You have to use role ID in a code:

    
    add_filter('wf_user_permission_roles', 'wf_user_permission_roles');
    
    function wf_user_permission_roles($roles) {
    
        $roles[] = 'manager';
        $roles[] = 'orders';
    
        return $roles;
    }
    
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.