T
T
thehighhomie2016-10-22 12:01:18
WordPress
thehighhomie, 2016-10-22 12:01:18

Wordpress woocommerce: how to allow viewing woocommerce settings and plugins not only for admin but also for other roles?

How can I allow viewing woocommerce settings and plugins not only for the admin but also for other roles?
For example, there is a plugin (some kind) and only users with manage_woocommerce rights can see it in the admin panel. That is, admins can see everything in the admin panel, and for example, users with lower rights cannot see the Woocommerce menu at all, only add-edit a product.
Which way to dig to allow such users to view this plugin? And whether it is necessary for such users to open the entire Woocommerce settings item or only the plugin can be added somewhere.
For example, I found the controller method in the plugin:

public function on_admin_menu() {
       add_submenu_page('edit.php?post_type=wishlist', __('Notifications', 'wc_wishlist'), __('Notifications', 'wc_wishlist'), 'manage_woocommerce', 'wc-wishlist-admin-notifications', array($this, 'do_notifications_page'));
  }

and replaced with:
public function on_admin_menu() {
       add_menu_page('Wishlist', 'Wishlist', 'manage_options', 'edit.php?post_type=wishlist', array($this, 'do_notifications_page') );
  }

It doesn’t roll (
I don’t really understand woocommerce, but if you direct me in which direction to dig, then I’ll do everything.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim, 2016-10-22
@maxus99

The direction seems to be correct.
Only 'manage_options' confused me, maybe there should be 'manage_woocommerce' ?

P
Pavel, 2016-10-22
@Palych_tw

https://ru.wordpress.org/plugins/user-role-editor/... tried?

I
Igor Vorotnev, 2016-10-22
@HeadOnFire

1. Install the User Role Editor plugin.
2; Come in, and having found the role you need, check off additional capabilities (Wookomers ones in this case).
3; Disable or even delete the plugin.
4. Profit!
PS: Despite the presence of the word user in the title, the plugin works with roles. You apparently read it as a User Role Editor, but it should be as a User Role Editor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question