Jump to content

Get group of client in web


Pau111111

Recommended Posts

Hello Prestashopers, I would like to get by js (if it can be) the type of client that is in session on the web, so I can show customized messages or change the appearance depending on the type of user.
 

Hello Prestashopers,

 

I would like to get by js (if it can be) the group of client that is in session on the web, so I can show customised messages or change the appearance depending on the type of user.

 

Thanks!

Link to comment
Share on other sites

You can write code like the following in a TPL file:
<script type="text/javascript">
var customer_group = {Group::getCurrent()->id|intval};
</script>

Then you can use the customer_group variable in your JavaScript.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...