2015-10-05 21 views
0

我是新的magento。我的網站上有藝術家概念。藝術家數據只有保存到數據庫,但未登錄馬真羅

我想,當一個藝術家寄存器,數據將保存到數據庫中,但它不會被登錄。

默認情況下,數據被保存到數據庫,它將進入儀表板頁面,但我想,當一個藝術家會做註冊然後數據將保存到數據庫,但不會登錄並重定向到同一頁面。

我嘗試了很多,但無法停止登錄概念只重定向到相同的頁面,但登錄functionalitily依然採用這種狀況

工作AccountController.php

if($data['artists']=='art'){    
    $successUrl = $this->_getUrl('artistregister/index/index', array('_secure' => true)); 
} 
else{ 
    $successUrl = $this->_getUrl('*/*/index', array('_secure' => true)); 
} 




protected function _successProcessRegistration(Mage_Customer_Model_Customer $customer) 
    { 
     $session = $this->_getSession(); 
     if ($customer->isConfirmationRequired()) { 
      /** @var $app Mage_Core_Model_App */ 
      $app = $this->_getApp(); 
      /** @var $store Mage_Core_Model_Store*/ 
      $store = $app->getStore(); 
      $customer->sendNewAccountEmail(
       'confirmation', 
       $session->getBeforeAuthUrl(), 
       $store->getId() 
      ); 
      $customerHelper = $this->_getHelper('customer'); 
      $session->addSuccess($this->__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please <a href="%s">click here</a>.', 
       $customerHelper->getEmailConfirmationUrl($customer->getEmail()))); 
      $url = $this->_getUrl('*/*/index', array('_secure' => true)); 
     } else { 
      $session->setCustomerAsLoggedIn($customer); 
      $url = $this->_welcomeCustomer($customer); 
     } 
     $this->_redirectSuccess($url); 
     return $this; 
    } 

如果有誰知道這一點,請幫助我出去了。 感謝

+0

你可以在這裏發表你的保存動作,藝術家數據保存在控制器中嗎? –

+0

我更新的代碼,請參見上面 – kingp

回答

0

您將需要通過功能

$session->setCustomerAsLoggedIn($customer); 
$url = $this->_welcomeCustomer($customer); 

你可以把條件您的藝術家在這裏並更改網址爲每把條件功能_successProcessRegistration

在這個函數的客戶在會議記錄你的要求。

+0

你能告訴我什麼都會,我會寫的條件,因爲當我寫這篇如果($數據[「藝術家」]!=「藝術」){\t \t \t \t}其他{$ session-> setCustomerAsLoggedIn($ customer); $ url = $ this - > _ welcomeCustomer($ customer);} .................它不起作用 – kingp

+0

我更新了代碼函數_successProcessRegistration請參閱上面的 – kingp

+0

ya我有現在做它工作正常,但問題是當我點擊註冊按鈕它重定向到主頁......請建議 – kingp