php - How can i set different custom login redirect for different types of users? -


i've got problem can't solve. partly because can't explain right terms. i'm new sorry clumsy question.

below can see overview of goal.

in site have 2 types of accounts 1) normal buyer account 2) seller account

when normal buyer login should redirect dashboard page & seller should redirect order history page.

for tried extension

http://www.magentocommerce.com/magento-connect/custom-login-redirect.html

but working 1 type of user example gave url seller in normal buyer account defaultly showing "you want become partner please contact admin"

how can solve task

i using magento ce1.7

may duplicate question sorry forgive me..

any ideas ?

you need create own module extends base class mage_customer_accountcontroller of magento , overrides _loginpostredirect function. complete example can found here:

redirect customer after login in magento

now within above method of _loginpostredirect, can customer group using following code:

if(mage::getsingleton('customer/session')->isloggedin()){   // group id   $groupid = mage::getsingleton('customer/session')->getcustomergroupid();   //get customer group name   $group = mage::getmodel('customer/group')->load($groupid);   //echo $group->getcode();   // got group code, redirection } 

above code getting customer group acquired showing group customer belongs in magento


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -