I apologize in advance for this question has been treated many times, but I think I just need a personal trainer on this!
I am trying to modify the function sendPasswordResetConfirmationEmail
in Mage/Customer/Model/Customer.php
public function sendPasswordResetConfirmationEmail()
{
$storeId = $this->getStoreId(); // ---->this is the line I need to change----<
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;
}
So I created a module called M2W_Password in local, it contains etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<M2W_Password>
<version>0.1.0</version>
</M2W_Password>
</modules>
<global>
<models>
<customer>
<rewrite>
<customer>M2W_Password_Model_Customer_Customer</customer>
</rewrite>
</customer>
</models>
</global>
</config>
And here is the updated function in Model/Customer/Customer.php
<?php
class M2W_Password_Model_Customer_Customer extends Mage_Customer_Model_Customer
{
public function sendPasswordResetConfirmationEmail()
{
$storeId = Mage::app()->getStore()->getId();
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;
}
}
?>
I cleared the cache, checked that the module is in Magento list of modules in system/configuration/Advanced, but the fix I put in my function is still not working.
EDIT --------------------------------
I just found out that another module extends the MAge_Customer_Model_Customer class. So here is my new class for Customer.php
class M2W_Password_Model_Customer_Customer extends Magestore_Onestepcheckout_Model_Customer_Customer {
But still it doesn't work. Which is weird because when I put the actual code I'm trying to implement directly in the other module Customer.php it works