• Resolved jeeya1609

    (@jeeya1609)


    Hello,

    Am not able to add new user with custom role when connected as shop manager.

    I have added the following code in functions.php

    /**
    * Allow Shop Managers to add another shop manager
    */
    function wt_shop_manager_role_edit_capabilities($roles) {

    $roles[] = ‘shop_manager’; // change role here for custom roles
    return $roles;
    }

    add_filter(‘woocommerce_shop_manager_editable_roles’, ‘wt_shop_manager_role_edit_capabilities’);

    The issue is there is a default role subscriber which is associated when i import the users with custom roles

    Can you please help.

    Regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @jeeya1609,

    We have updated the snippet to import users using the shop manager role. Please copy the updated snippet from here and replace “customrole” with your desired custom role name.

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    Aplogies, but the amended code doesn’t allow me to import user with custom roles only as shop manager.

    When i use your code, the user with custom role is also having the role subscriber.

    Can you please advise.

    Thanks

    Plugin Author WebToffee

    (@webtoffee)

    Hi @jeeya1609,

    Please tell us how you have added custom roles to your site and mention the name of the custom role with which you are facing the issue.

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    I have used the User Role Editor plugin to create the custom roles : user pro and pro2 mcb factors.

    When i use the above code to allow shop manager to import user with custom roles. There is a default role “subscriber” assigned to them on top of the custom role that they need to have.

    So, When i import the users, they have Subscriber, PRO

    They need to have pro only.

    Can you please help

    Plugin Author WebToffee

    (@webtoffee)

    Hi @jeeya1609,

    We have tested the same on our test site and only the custom role was assigned for the imported user. Please share your importing CSV file via support after removing user-sensitive data from it so that we can check it.

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    I have uploaded the file which i have use to import the user with custom roles.

    Thanks

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello again,

    I can confirm that the plugin is working fine now.

    I have been able to import and update user with custom roles using the role shop manager

    Many thanks for your help.

    Regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Unable to import csv with user role shop manager’ is closed to new replies.