Magento. Failed to rewrite address model

I'm trying to rewrite the Magento Address Model, but I'm going crazy with that. My rewrite section of config.xml is as follows:

<models>
    <customer>
         <rewrite>
             <customer>MyNam_MyMod_Model_Customer</customer>
             <address>MyNam_MyMod_Customer_Model_Address</address>
         </rewrite>
    </customer>
</models>

and my class looks like this:

require_once 'Mage/Customer/Model/Address.php';
class MyNam_MyMod_Customer_Model_Address extends Mage_Customer_Model_Address
{


public function validate() {
    parent::validate();
}
}

When I load the address form, I get the following error: calling the getId () member function for the non-object in /var/www/magento/app/code/core/Mage/Customer/Block/Address/Edit.php on line 53

I noticed that the editing unit cannot load the client / address model

Can anybody help me?

+3
source share
2 answers

Hope the class address MyNam_MyMod_Customer_Model_Address, I should be MyNam_MyMod_Model_Address

<models>
    <customer>
         <rewrite>
             <customer>MyNam_MyMod_Model_Customer</customer>
             <address>MyNam_MyMod_Model_Address</address>
         </rewrite>
    </customer>
</models> 

let me know if you have a problem ...

0
source

require_once 'Mage/Customer/Model/Address.php'; , . . var/cache?

0

All Articles