Jump to content

I need footer change depending on user group


Shellanza

Recommended Posts

Very easy to think but an hell to do.

 

Actually I have my list of links on my footer. I need to print a link in the case the user is a normal user and another link if the user is a user with a different group.

 

I already have the script in .TPL to manage but this footer data are written on database... hd_config exactly

 

So actually I can't run php neither play with TPL.

 

What I can do?

 

:-( 

Link to comment
Share on other sites

You can do some like this;

 

in FrontController, in init function, add:

 

if(!$this->context->customer->isLogged()){
            $customer=null;
        }else{
            $customer = new Customer($this->context->customer->id);
        }
 
then, add $customer to context.
 
customer group: $customer->id_default_group;
 
in your tpl, do a if conditional with this var,
 
with {$link} var (link object) you can get the links you need ( {$link->getCategoryLink(1)} example, check class Link methods )
 
Is this what you need?
Edited by buhoplace (see edit history)
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...