如何在Magento中为客户登录创建observer
?
<events>
<customer_login> <!-- identifier of the event we want to catch -->
<observers>
<Vi_Cartproduct> <!-- identifier of the event handler -->
<type>singleton</type> <!-- class method call type; valid are model, object and singleton -->
<class>cartproduct/observer</class> <!-- observers class alias -->
<method>removeProduct</method> <!-- observer's method to be called -->
<args></args> <!-- additional arguments passed to observer -->
</Vi_Cartproduct>
</observers>
</customer_login>
</events>
上述事件无效
答案 0 :(得分:2)
试试这个......
<events>
<customer_login>
<observers>
<vi_cartproduct_model_observer>
<type>singleton</type>
<class>Vi_Cartproduct_Model_Observer</class>
<method>removeProduct</method>
</vi_cartproduct_model_observer>
</observers>
</customer_login>
</events>
答案 1 :(得分:1)
如果您只想自定义主题,您可以在布局中添加<customer_logged_in>
和<customer_logged_out>
句柄,以便添加或删除任何块。