Public Ticket #3447281

Hide Sales Agent Commissions from Sales Agents on order edit screen

Closed
Comments
13 Tickets 10
2A Admin started the conversation 3 years ago on August 29, 2023 at 6:26pm

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?

2,762
KingsPlugins replied 3 years ago on August 30, 2023 at 8:00am

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

13 Tickets 10
2A Admin replied 3 years ago on August 30, 2023 at 3:06pm

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.

13 Tickets 10
2A Admin replied 3 years ago on September 1, 2023 at 6:54pm

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;
} ```



Sign In