Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 客户注册成功观察员不工作_Magento_Observers - Fatal编程技术网

Magento 客户注册成功观察员不工作

Magento 客户注册成功观察员不工作,magento,observers,Magento,Observers,我想在我的模块里做一个观察者 该方法适用于客户注册成功事件 配置文件: <events> <customer_register_success> <observers> <customer_register_success_handler> <type>Model</type> <class>cardnumber/observer</class>

我想在我的模块里做一个观察者 该方法适用于客户注册成功事件 配置文件:

<events>
  <customer_register_success>
    <observers>
      <customer_register_success_handler>
        <type>Model</type>
        <class>cardnumber/observer</class>
        <method>GenerateCardNumber</method>
      </customer_register_success_handler>
    </observers>
  </customer_register_success>
</events>
我不知道有什么问题 使用magento 1.8 有什么帮助吗
提前thanx这是呼叫观察者的基本示例

</global>    
<events>
                <controller_action_predispatch>
                    <observers>
                        <openstream_geo_model_html_after>
                            <type>singleton</type>
                            <class>geoip/observer</class>
                            <method>getLocationInfoByIp</method>
                        </openstream_geo_model_html_after>
                    </observers>
                </controller_action_predispatch>
            </events>
类不应该被扩展。只需如上所述提及类名。
如果您能简单地解释一下您面临的错误,那就更好了。

rrami,我想,您在config.xml方面有问题

我正在写一个客户成功观察者的例子

 <?xml version="1.0" encoding="UTF-8"?>
    <config>
<modules>
        <Namespace_Modulename>
            <version>0.0.1</version>
        </Namespace_Modulename>
    </modules>
        <global>
            <models>
                <your_module>
                    <class>Your_Module_Model</class>
                </your_module>
            </models>
        </global>
        <frontend>
            <events>
                <customer_register_success>
                    <observers>
                        <your_module>
                            <type>model</type>
                            <class>your_module/observer</class>
                            <method>customerSaveAfter</method>
                        </your_module>
                    </observers>
                </customer_register_success>
            </events>
        </frontend>
    </config>

0.0.1
您的_模块_模型
模型
您的_模块/观察员
顾客储蓄

将模型更改为模型您可以显示您的config.xml吗?在管理员添加了新成员后,我将收到事件。将其放在前端是否正确???这并没有解决问题,thanx for Response我发现了一些问题只有当客户注册帐户时才会发送此事件管理员也创建了一个新客户帐户时我才能让它发生吗?下面是后端事件:adminhtml\u customer\u save\u after。。我把所有东西都放在了全球标签上终于起作用了。。thanx allout of global!!在任何标记中,它都应该是??我发现了一些事情,只有当客户注册帐户时,才会发送此事件。管理员也可以在创建新客户帐户时使其发生??以下是后端事件:adminhtml\u customer\u save\u after。。我把所有东西都放在了全球标签上终于起作用了。。thanx all
class Openstream_GeoIP_Model_Observer
{
    public function controllerFrontInitBefore($observer) {
    die();
    }
   }
 <?xml version="1.0" encoding="UTF-8"?>
    <config>
<modules>
        <Namespace_Modulename>
            <version>0.0.1</version>
        </Namespace_Modulename>
    </modules>
        <global>
            <models>
                <your_module>
                    <class>Your_Module_Model</class>
                </your_module>
            </models>
        </global>
        <frontend>
            <events>
                <customer_register_success>
                    <observers>
                        <your_module>
                            <type>model</type>
                            <class>your_module/observer</class>
                            <method>customerSaveAfter</method>
                        </your_module>
                    </observers>
                </customer_register_success>
            </events>
        </frontend>
    </config>