Jump to content

Client Group ID global variable PS. 1.7


Andrejkov

Recommended Posts

Hello,

I need to add some modifications to my theme and i need to use "IF CODE", something like this:

{if CUSTOMER GROUP ID == '1'} DO SOMETHING {else} CODE {/if}

But I don't know what variable returns Customer group id. Does anyone know what variable to refer to in this condition?

Regards.

 

Link to comment
Share on other sites

Hi,

{if $customer.is_logged} 
  {if Customer::getDefaultGroupId((int)$customer.id) == '1'}
    customer group = 1
  {elseif Customer::getDefaultGroupId((int)$customer.id) == '2'}
    customer group = 2
  {else}
    customer in another group: {Customer::getDefaultGroupId((int)$customer.id)}
  {/if}
{else}
  guest ID: {Context::getContext()->cookie->id_guest}
{/if}

 

  • Thanks 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...