2015-12-18 67 views
0

我想改變客戶登錄和賬戶網址改變客戶登錄網址

當前的URL是http://www.store.com/customer/account/login/

我想這個http://www.bandenmatch.nl/account/

我創建了一個CMS頁面,並加載登錄改變該網頁的工作正常,但它仍然可見當客戶登錄

$redirect_url = Mage::getUrl('customer/account/login/'); 
$current_url = Mage::helper('core/url')->getCurrentUrl(); 
if((!$this->helper('customer')->isLoggedIn()) && ($current_url != $redirect_url)){ 
    Mage::app()->getFrontController()->getResponse()->setRedirect($redirect_url); 
} 

回答

0

我認爲這是因爲你的if st

... 

    if((!$this->helper('customer')->isLoggedIn()) 

...

嘗試更改代碼下面將檢查客戶會話,看看他們是否已經登錄:檢查時,如果客戶被記錄在這裏atement失敗

 

    $redirect_url = Mage::getUrl('customer/account/login/'); 
    $current_url = Mage::helper('core/url')->getCurrentUrl(); 
    if((!Mage::getSingleton('customer/session')->isLoggedIn()) && ($current_url != $redirect_url)){ 
    Mage::app()->getFrontController()->getResponse()->setRedirect($redirect_url); } 

我希望這幫助。