Okay
  Public Ticket #3218664
Hide coupon
Closed

Comments

  •  2
    zalqis started the conversation

    Hi, can I hide these features for only certain agent groups ?

    1. Coupon Discount

    2. My Team 

    Thanks in advance.

  •  1,906
    WebWizards replied

    Hi there,

    Yes, to do that please add this PHP code snippet to your site:

    add_filter('salesking_dashboard_menu', function($menu_items){
        $user_id = get_current_user_id();
        $agent_group = get_user_meta($user_id,'salesking_group', true);
        if ($agent_group == 1234 or $agent_group == 4567){
            unset($menu_items['coupons']);
            unset($menu_items['team']);
        }
        return $menu_items;
    }, 10, 1);
    


    You would need to replace 1234 with the ID of your agent group that you want those hidden for. To get the ID of a group, go to SalesKing -> Agent Groups and click on the group. The number in the URL such as ?post=123 is the ID.

    The above code removes those panels for groups 1234 and 4567.


    A PHP 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/


    Kind regards,

    Stefan