User Type In Backend Php Code

How to find if the user logged in backend is ADMIN or Vendor Admin in the php code ?

How to find if the user logged in backend is ADMIN or Vendor Admin in the php code ?

Hello! The user type ("A" or "V") is stored in this variable:

Tygh::$app['session']['auth']['user_type']

If you have the old CS-Cart version:

$_SESSION['auth']['user_type']

As alternative you can use

if (ACCOUNT_TYPE == 'admin') {
   ...
}
if (ACCOUNT_TYPE == 'vendor') {
   ...
}

thanks both options work

Hi,

Am new here. How do I create another ACCOUNT_TYPE? Can I copy the vendor.php file's content to a new file and change the ACCOUNT_TYPE? What I need is a fourth set of users, who will be tasked with only the shipping management of orders assigned to them. Creating a new Administrator group and restricting privileges only to shipping is enough to get this working?

I think, new user type is not required here. You can play with admin permissions. But most possibly additional custom development work will be required

good info