2013-07-01 18 views
2

有沒有人知道在哪裏可以找到在發送給用戶的電子郵件中生成忘記密碼重置鏈接的功能?Magento - 被遺忘的密碼鏈接生成使用的是不正確的商店視圖

由於某些奇怪的原因,我在URL中生成的重置密碼鏈接與用於重置密碼的商店視圖中的不同商店視圖相比較。

鏈接應該是:

example.com/customer/account/resetpassword/?id=555&token=55555555555555555

但它正在產生這樣:

example.com/otherStoreView/customer/account/resetpassword/?id=555&token=55555555555555555

+0

這個問題在1.8.1.0 – Cninroh

回答

2

該電子郵件模板是: 應用程序/區域/ langcode_COUNRTYCODE /模板/email/account_password_reset_confirmation.html

而且生成URL的行是

{{store url="customer/account/resetpassword/" _query_id=$customer.id _query_token=$customer.rp_token}} 
+0

也存在啊啊,非常感謝謝爾蓋!我現在欠你兩個! – NateTheGreatt

3

要解決此問題,請打開文件「app \ code \ local \ Mage \ Customer \ Model \ Customer.php」。

尋找功能sendPasswordResetConfirmationEmail()。這是附近行685

這個功能看起來是這樣的:

/** 
* Send email with reset password confirmation link 
* 
* @return Mage_Customer_Model_Customer 
*/ 
public function sendPasswordResetConfirmationEmail() 
{ 
    $storeId = $this->getStoreId(); 
    if (!$storeId) { 
     $storeId = $this->_getWebsiteStoreId(); 
    } 

    $this->_sendEmailTemplate(self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, 
     array('customer' => $this), $storeId); 

    return $this; 
} 

在這個函數中,Magento的越來越其中用戶登記店鋪ID,但我們需要的店鋪ID,在那裏他取得了密碼重置請求。我們只需要刪除一些行並添加一個新行:

public function sendPasswordResetConfirmationEmail() 
{ 
    # this will get the current store ID 
    $storeId = Mage::app()->getStore()->getStoreId(); 

    $this->_sendEmailTemplate(self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, 
     array('customer' => $this), $storeId); 

    return $this; 
} 

這對我有用,我希望它有幫助。

+0

Upvoted無法在覈心進行此更改,但正確地將其移至/本地:) – siliconrockstar

相關問題