Okay
  Public Ticket #2954106
assigning default agent
Closed

Comments

  • faiz started the conversation

    hi, for this feature "Assign Agent Automatically at Registration", how do I set which agent will get automatically assign?

  •  1,906
    WebWizards replied

    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

  • faiz replied

    yes please, I would like to have those code snippet to set a specific agent when intially no agent is assigned.

  •  1,906
    WebWizards replied

    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://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/

    Kind regards,

    Stefan

  • faiz replied

    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?

  •  1,906
    WebWizards replied

    Yes Sir, that is exactly correct.

    Let me know if that works correctly for you or if there's anything I can do to help.