Okay
  Public Ticket #2869266
adding agent user to a specific role
Closed

Comments

  • faiz started the conversation

    I'm using an if menu where I want the agent dashboard page menu will only be shown 
    1. to the specific user role
    2. is login

    I want to setup that each agent have the same clearance as a customer role but have different role name.

  •  1,906
    WebWizards replied

    Hi Faiz,

    Thank you for purchasing SalesKing!


    If you want to hide the "Agent Dashboard" item in the menu for users that are not agents, it would be simple to hide it with CSS (I think doing it with a different role is much harder). SalesKing adds classes to the body, so we can use that to hide it.

    You can add:

    .salesking_not_agent #your_menu_item{
        display: none !important;
    }

    In the above CSS, you just need to replace #your_menu_item with the class/ID of the item in your menu. I can give you the correct ID/class if you can give me a link to your website.


    Kind regards,

    Stefan



  •   faiz replied privately
  •  1,906
    WebWizards replied

    Glad that's sorted!


    Yes, you can achieve that redirect by adding this PHP code snippet to your site:

    add_filter('salesking_sales_agent_redirect', function($redirect_to){
        return get_home_url();
    }, 10, 1);
    

    Tested and it works, agents are redirected to the homepage when they log out.

    Kind regards,

    Stefan