Trying to override _beforeSave method and Magento calling both custom method and core method as well -


all trying override _beforesave() method in resource model mage_customer_model_resource_customer.

there no problem in overriding can call custom _beforesave method in custom class.

config custom class is:

<?xml version="1.0" encoding="utf-8"?>   <config>     <modules>         <abc_customer>             <version>0.1.0</version>         </abc_customer>     </modules>      <global>                <models>             <cust>                 <class>abc_customer_model</class>                    <resourcemodel>cust_resource</resourcemodel>              </cust>               <cust_resource>                 <class>abc_customer_model_resource</class>             </cust_resource>             <customer_resource>                 <rewrite>                     <customer>abc_customer_model_resource_customer</customer>                 </rewrite>                             </customer_resource>             </models>     </global>  </config> 

after have created abc_customer_model_resource_customer class, copied _beforesave method core class , changed according need.

but problem magento calling both of methods.

how can stop behaviour , let custom method run?

please suggest.

thanks

the same question answered here. main idea if copied method original class, line parent::_beforesave($customer) call original method.
can replace line

mage_eav_model_entity_abstract::_beforesave($customer); 

thanks @proxiblue idea.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -