Skip Navigation

[Resolved] woocommerce settings

This support ticket is created 7 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 3 voices.

Last updated by Alex Cespedes 7 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#432413

Hi,

I created a new role 'Assistant Shop Manager' and the person can manage orders & products but cannot change the woocommerce settings.
hidden link

How can I do that?

Thanks.

#432595

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To remove woo commerce settings menu for specific role, you should use following code - Try to add following code to your current theme's functions.php file:

add_action( 'admin_menu', 'remove_menu_pages', 999);
function remove_menu_pages() {
global $current_user;

$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if($user_role == "YOUR-ROLE") {
$remove_submenu = remove_submenu_page('woocommerce', 'woocommerce_settings');
}
}

Where:
Replace "YOUR-ROLE" with your role name.

#432745

Hi,

I created a role 'Shop Manager Test', how do I check what is the value to put into 'YOUR-ROLE'.
Tried these and they don't work
if($user_role == "Shop Manager Test") {
if($user_role == "shop-manager-test") {

And the code that you provided only hides the menu but user can still access it if they know the url?
Thanks.

#432902

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please share access details with me.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#435966

Hi,

I found out the issue, 'woocommerce_settings' is not correct and we need to use 'wc-settings' and it is ok 🙂

$remove_submenu = remove_submenu_page('woocommerce', 'wc-settings');

Thanks for the help to supply the code.

#522705
MCfunctions.jpg

Hi, I'm also trying to restrict access to the "Settings" tab for a user role of "Reception" and I tried using the code above, but still doesn't work. Tried both suggestions inside the code: "woocommerce_settings" and also "wc-settings" but it still doesn't work.

Any advice?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.