Okay
  Public Ticket #2956233
Customize ID
Closed

Comments

  •  1
    Elix started the conversation

    Hi is there a way to customized agent Id when creating / modify agent ( for sub agent too in team creation ) ? 

    And How do I make a registering page for agents with agent Id input available + a code in order to restrict registration ?  

  •  1,906
    WebWizards replied

    Hi Elix,

    Thank you for getting in touch,

    The agent ID (the number assigned to each agent e.g. G2SKMS3) is a number that is randomly generated by the plugin when the agent is first created. The only way to change this number would be programmatically. We can assist with information on how that could be done, but our plugin doesn't have features for this.


    An agent registration page is possible by using SalesKing together with our B2BKing plugin ( https://1.envato.market/NMWbV ) B2BKing has a registration feature that is integrated with SalesKing.

    You could create a custom field where agents can enter a desired agent ID when they register. However there is no way with the plugin to restrict this registration to only those who have a code / password. (You can set a captcha if that's what you meant).


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

    Kind regards,

    Stefan

  •  1
    Elix replied

    Hi Stefan , 

    Yes I know that it's randomly generated and you don't have that feature but it's too long and too random for my use case, I know it's not that hard to implement but I don't know much about PHP.  Your B2B is great , I don't need it for now but I may use it , If my company get bigger. It's too expensive for only the registration part without using others features. 

    That is why I need a snippet to : 

    add an input for agent ID in new user creation page of wordpress ( admin ) with an error if an ID is already used 

    add an input for modifying agent ID in user profile page ( admin ) with an error if an ID is already used 

    add an input for agent ID in new sub agent creation with an error if an ID is already used 

    And also Where to find the random generator to change the randomization logic 

    Thanks for your help  

  •  1,906
    WebWizards replied

    Hi Elix,

    The generation of that number happens in the plugin folder/public/dashboard/salesking-dashboard.php

    This is the code responsible:

    if (empty($agent_id)){
                    $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
                    $agent_id = '';
                    for ($i = 0; $i < 10; $i++)
                    $agent_id .= $characters[mt_rand(0, 35)];
                    $agent_id = strtoupper($agent_id);
                    update_user_meta($user_id,'salesking_agentid', $agent_id);
                }
    

    We can add a filter there if it helps.


    Unfortunately, I don't have a snippet that could add an agent ID field in user creation/ profile/ subagents etc. It's a large task that needs to be handled through multiple files, javascript, etc and not something I can provide easily through just a snippet.


    Kind regards,

    Stefan

  •   Elix replied privately
  •   WebWizards replied privately