Prestashop 如何知道新用户何时在商店注册

Prestashop how to know when a new user makes register in the store

我正在使用 prestashop 1.6。我想知道我怎样才能知道有用户何时在商店注册?有什么钩子之类的吗?任何帮助和建议都将非常感激。 谢谢

您将在管理面板中收到通知。左上角。用户图标 -> 当新客户注册时,此图标将显示注册用户数 1、2、120。单击用户图标以清除计数器

有一个挂钩,它会在客户成功注册到网站后立即调用。 钩子名称是 actionCustomerAccountAdd,您可以通过 function hookActionCustomerAccountAdd($params){ ... } 在您的自定义模块中调用它,并通过 $this->registerHook('actionCustomerAccountAdd')

注册它

钩子的代码在 AuthController 中找到:

    Hook::exec('actionCustomerAccountAdd', array(
                        '_POST' => $_POST,
                        'newCustomer' => $customer
                    ));

如您所见,您可以访问注册表单的完整 $_POST + 使用它创建的新客户对象。 如果您需要有关如何使用挂钩的示例,您可以查看 blocknewsletter 模块的代码,它使用 actionCustomerAccountAdd 挂钩,就在您需要的时候。