Comments 2Renan Braz started the conversationApril 29, 2024 at 7:58pmHello, I would like to know how can I stop the sales rep from editing any of the order informations. Specially the status. I already tried editing the roles of the agent on wordpress, but it doesn't make much difference. Best regards 2,724WebWizards repliedMay 3, 2024 at 11:50amHello Renan,You can add the following PHP code snippet to your site to remove the various options and buttons that allow the agent to edit the order: add_action('admin_head', function(){ if (is_agent(get_current_user_id())){ ?> <style> #woocommerce-order-actions, .edit_address, .add-items{ display: none !important; } </style> <script> jQuery(document).ready(function(){ jQuery('#woocommerce-order-actions, .edit_address, .add-items').remove(); }); </script> <?php } }); function is_agent($user_id){ $agent_group = get_user_meta($user_id,'salesking_group',true); if ($agent_group !== 'none' && !empty($agent_group)){ return true; } else { return false; } } This snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/Let me know if you need anything else, any button or area there to be removed, and I can adjust the snippet for that,Kind regards,Stefan Sign in to reply ...
Hello,
I would like to know how can I stop the sales rep from editing any of the order informations. Specially the status.
I already tried editing the roles of the agent on wordpress, but it doesn't make much difference.
Best regards
Hello Renan,
You can add the following PHP code snippet to your site to remove the various options and buttons that allow the agent to edit the order:
add_action('admin_head', function(){ if (is_agent(get_current_user_id())){ ?> <style> #woocommerce-order-actions, .edit_address, .add-items{ display: none !important; } </style> <script> jQuery(document).ready(function(){ jQuery('#woocommerce-order-actions, .edit_address, .add-items').remove(); }); </script> <?php } }); function is_agent($user_id){ $agent_group = get_user_meta($user_id,'salesking_group',true); if ($agent_group !== 'none' && !empty($agent_group)){ return true; } else { return false; } }This snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Let me know if you need anything else, any button or area there to be removed, and I can adjust the snippet for that,
Kind regards,
Stefan