Question

Now based on two different user groups named "Customers"(the default ones in magento) and "Members"(our customized ones), I have different info. to display and so two different dashboards for both type of users.

The functions related to "Members" is handled by our custom module of membership.

But at the same time, the group "Members" retain functionality of being both "Customers" as well as "Members". So when a Member login he can see the same left navigation as normal customers.

But the part is here "Account Dashboard" is a link that always redirects to a normal customer dashboard rather than the Member ones.

So i want that, when a normal customer logs-in, that should redirect to a normal dashboard but when a Member logs-in, it should redirect to a Member dashboard from each page!

How do I achieve this???? Thanks in advance......

Was it helpful?

Solution

You can break this down into a few steps:

  • Make a controller that handles the initial login (lets call it MembersLoginController)
  • In the indexAction (lets assume this is where the customer is going) check what group the customer is from using the following code:

    $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();

  • Using an if statement redirect the customer to the link you want using this code:

    $this->_redirect($url);

  • Important Make sure that any action method you have declared in the controller checks whether the customer is logged in and has permission to see that page (you can create a helper method that returns tru/false)

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top