Public Ticket #2954106

assigning default agent

Closed
Comments
2,762
KingsPlugins replied 5 years ago on January 10, 2022 at 5:14pm

Hi Faiz,

Thank you for purchasing our plugin,

The way it works is that if the plugin has any way to connect the user to an agent, it will give it to a specific agent. For example if the customer used an agent coupon, an agent affiliate link, cookie, etc, the plugin will assign the user to that agent.

If there is no connected agent, then the plugin will choose a random agent at registration.

Do you want to choose 1 specific agent instead of a random one? I may be able to help with a code snippet.


Kind regards,

Stefan

2,762
KingsPlugins replied 5 years ago on January 11, 2022 at 6:52pm

Hi,

Please add the following code snippet:

add_filter('salesking_assign_automatically_agent_id', function($agent_id){
            return 123;
        }, 10, 1);

You will need to replace 123 with the ID of your sales agent. To get the ID, you can go to Users-> click on a user, and the number in the URL is the ID. (e.g. user-edit.php?user_id=123)

You can add the snippet to functions.php or by following our guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

Kind regards,

Stefan

3 Tickets
faiz replied 5 years ago on January 12, 2022 at 1:39am

hi, thanks for the snippet. Just making sure, this snippet will only assign an agent automatically if there is no agent assign when user create the new account right? If a specific agent was assigned, the snippet will have no effect right?

Sign In