hi,
I have a working module that sets a privacy attribute to customer account. Now I'm trying to write an observer to save that value after a customer registration, but it's not fired. This is my config:
<?xml version="1.0"?> <config> <modules> <Hoop_Privacy> <version>0.1.0</version> </Hoop_Privacy> </modules> <frontend> <events> <customer_register_success> <observers> <hoop_privacy> <type>singleton</type> <class>hoop_privacy/observer</class> <method>customerRegisterSuccess</method> </hoop_privacy> </observers> </customer_register_success> </events> </frontend> <global> <helpers> <privacy> <class>Hoop_Privacy_Helper</class> </privacy> </helpers> <models> <privacy> <class>Hoop_Privacy_Model</class> <resourceModel>privacy_mysql4</resourceModel> </privacy> </models> <resources> <customerattribute1527753925_setup> <setup> <module>Hoop_Privacy</module> <class>Mage_Customer_Model_Entity_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </customerattribute1527753925_setup> <customerattribute1527753925_write> <connection> <use>core_write</use> </connection> </customerattribute1527753925_write> <customerattribute1527753925_read> <connection> <use>core_read</use> </connection> </customerattribute1527753925_read> </resources> </global> </config>
so I have Observer.php inside /app/code/Hoop/Privacy/Model, but event is not fired at all.
any help?
thanks a lot
Solved! Go to Solution.
You need to declare classpath in your observer, replace
<class>hoop_privacy/observer</class> with <class>Hoop_Privacy_Model_Observer</class>
Now,
<customer_register_success> <observers> <hoop_privacy> <type>singleton</type> <class>Hoop_Privacy_Model_Observer</class> <method>customerRegisterSuccess</method> </hoop_privacy> </observers> </customer_register_success>
You need to declare classpath in your observer, replace
<class>hoop_privacy/observer</class> with <class>Hoop_Privacy_Model_Observer</class>
Now,
<customer_register_success> <observers> <hoop_privacy> <type>singleton</type> <class>Hoop_Privacy_Model_Observer</class> <method>customerRegisterSuccess</method> </hoop_privacy> </observers> </customer_register_success>