user3362364
user3362364

Reputation: 477

Show custom link only to certain user groups in magento

i'm using a custom template and has a static block using it as a custom menu along with the categories.

I've created a menu using tags

    <li>info for non-wholesale users</li> 

and would like to hide one such tag from wholesale group. how should i proceed?

i'm using magento 1.8.1

Upvotes: 1

Views: 1489

Answers (1)

Amit Bera
Amit Bera

Reputation: 7611

The resolution

 if(Mage::getSingleton('customer/session')->isLoggedIn()){
          // Get group Id
          $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
          //Get customer Group name
          $group = Mage::getModel('customer/group')->load($groupId);
        //  echo $group->getCode();
    if($group->getCode()!="retailer"){
    // here  put your code 
    }
    }else{
        // here  put your code 


    }

Upvotes: 2

Related Questions