Sales Agents can view the Sales Agent Commissions section when editing an order. Is it possible to make it so only admins can see that block? Or at least only be able to select their sub-agents and not themselves or other agents?
I checked: the plugin sets this so that all users who have the "manage_woocommerce" capability can see that box. Normal agents wouldn't be able to see it.
Usually "manage_woocommerce" is a capability that the shop manager has, as it gives a lot of permissions, changing shop settings, etc - it's something only very few users would have.
I am not sure how this works on your site or whether you have a different setup. Normally we would advise to give agents the 'customer' role only.
We created a custom role called Sales Agent because we need them to have access to a couple of functions in other plugins and giving them that permission seems to be the only way to do it. Let me see if I can hide it another way. Thanks.
Sales Agents can view the Sales Agent Commissions section when editing an order. Is it possible to make it so only admins can see that block? Or at least only be able to select their sub-agents and not themselves or other agents?
Attached files: Screen Shot 2023-08-29 at 1.18.12 PM.png
Hi Justin,
I checked: the plugin sets this so that all users who have the "manage_woocommerce" capability can see that box. Normal agents wouldn't be able to see it.
Usually "manage_woocommerce" is a capability that the shop manager has, as it gives a lot of permissions, changing shop settings, etc - it's something only very few users would have.
I am not sure how this works on your site or whether you have a different setup. Normally we would advise to give agents the 'customer' role only.
Kind regards,
Stefan
We created a custom role called Sales Agent because we need them to have access to a couple of functions in other plugins and giving them that permission seems to be the only way to do it. Let me see if I can hide it another way. Thanks.
I've accomplished this with some custom css and PHP for now.
```function enqueuing_admin_scripts(){
if (current_user_can('sales_agent')) {
// Enqueue the custom CSS file
wp_enqueue_style('salesagent-styles', get_stylesheet_directory_uri() . '/salesagent-styles.css');
}
}
add_action( 'admin_enqueue_scripts', 'enqueuing_admin_scripts' );```
``` #poststuff #salesking_order_commission_metabox {
display: none !important;
} ```
Wonderful, thank you!