2013-07-24 26 views
1

我有這個問題,我無法解決。部分原因是我無法用正確的術語解釋它。我對此很陌生,所以對於這個笨拙的問題感到抱歉。如何爲不同類型的用戶設置不同的自定義登錄重定向?

您可以在下面看到我的目標概覽。

在我的網站,我有兩種類型的帳戶1)普通買家帳戶 2)賣方賬戶

的當普通買家登錄它應該重定向我的儀表板頁面& 的賣家應該重定向到我的訂單歷史記錄頁。

爲了這個,我試圖用這個擴展

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

但它的工作只有一個類型的用戶,例如我給的URL,賣方在普通買家帳戶defaultly它顯示「你要成爲一個合作伙伴請聯繫管理員」

我怎樣才能解決我的任務

我使用的Magento CE1.7

可能是它的一個重複的問題對不起,只是原諒我..

任何想法?

+0

任何人都可以幫到我嗎? – Jhon

回答

1

您需要創建自己的模塊,它基本上擴展了Magento的基類Mage_Customer_AccountController並覆蓋了_loginPostRedirect函數。一個完整的例子可以在這裏找到:

Redirect Customer After Login in Magento

現在內,上面的_loginPostRedirect方法,您可以使用下面的代碼獲取客戶羣:

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(); 
    // You got the group code, do the redirection 
} 

以上爲獲取客戶羣的代碼是從收購Showing which group a customer belongs to in Magento

+0

對不起,說這個人不適合我 – Jhon

+0

好的,請讓我知道你正在得到什麼問題/錯誤? –

+0

是的肯定在此之前,請記住一件事老闆我對這項技術很陌生 – Jhon

相關問題