The Grid Woocommerce Vendors

Hi there,

I have both The Grid and Woocommerce Vendors installed on my site.

When Vendors log in to add a new product, it shows them options for The Grid plugin. I would like to limit the access, so that only site admins can see The Grid and Vendors don’t see it. Is there a way I can do this?

I am still in the process of starting my site, so I can change any style sheet or code without affecting anything if that helps.

Kind regards,

Max

Hi Max,

Please install and activate the child theme first.

After that adding this code under functions.php file locates in your child theme:

add_action('admin_head', 'print_admin_style');
function print_admin_style(){
	if(!current_user_can( 'administrator' )){
	?>
	<style type="text/css">#toplevel_page_the_grid{display: none !important;}</style>
	<?php
	}
}

Let us know how it goes!

Hi and thanks for the quick reply!

I’ve added a child theme and edited the functions.php file to include your code. However if I sign in with my test account (not a site admin, vendor admin only - which means they have restricted access to the dashboard through woocommerce product vendors plugin, but can edit their own products and availabilities) I can still see The Grid when I try and add a new Product. It comes up with ‘The Grid - Item Format’ panel.

Any suggestions?

Max

Hi Max,

In that case, you have to replace this line if(!current_user_can( 'administrator' )){ with another filter that pertains to the vendor access roles. It is best to consult the developer of the plugin at this point. Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.