Public Ticket #2981208

How to avoid editing the price of a product to a group of specific agents if the option is selected at the configuration level.

Closed
Comments
1 Ticket
amursuli started the conversation 5 years ago on February 14, 2022 at 4:35pm

How to avoid editing the price of a product to a group of specific agents if the option is selected at the configuration level.

2,762
KingsPlugins replied 5 years ago on February 15, 2022 at 12:05am

Hi there,

Thank you for getting in touch,

It's not possible to set this differently for specific products. The way it works is that you can configure a "maximum allowed discount" for your agents (e.g. 5%), and then agents can discount all product prices by a maximum of that number (5%).

Let me know if I can help with anything, or if you have any questions,

Kind regards,

Stefan


1
1 Ticket
amursuli replied 5 years ago on February 15, 2022 at 2:54pm

Hi Stefan, thanks for the quick response.

The idea is that a group of agents cannot increase the price of the products, so this cannot be possible?

2,762
KingsPlugins replied 5 years ago on February 16, 2022 at 1:46am

Hi again,

There's a setting for this in SalesKing -> Settings -> Agent Capabilities -> Agents can edit prices to increase price. This setting is only global (for all agents).


However, we can assist you, as part of support, with a PHP code snippet that enables/disables this option for specific agent groups. Such a snippet would be added to functions.php or by using a snippets plugin.


Kind regards,

Stefan

1
2,762
KingsPlugins replied 5 years ago on February 16, 2022 at 6:07am

You can use the following snippet for that:

add_filter('salesking_agents_can_edit_prices_increase_setting', function($val){
    $disable_group_id = 1234;
    // get agent group
    $user_id = get_current_user_id();
    $user_group = get_user_meta($user_id,'salesking_group', true);
    if (intval($user_group) === $disable_group_id){
        // disable for specific group
        $val = 0;
    }
    
    return $val;
}, 10, 1);

You would need to replace 1234 with the ID of your group. To get the agent group ID, you can go to SalesKing -> Agent Groups -> click on the group. The number in the url is the ID (for example if the URL contains ?post=123, then the ID is 123).

A PHP snippet can be added to functions.php, or by following our guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

Let me know if I can help with anything, or if you have any questions,

Kind regards,

Stefan

1

Sign In