我正在尝试在我的自定义模块中添加一个钩子,但是在我在 prestashop 后台或使用 web 服务中添加一个客户后它没有被触发。
我要注册的钩子名称是“actionCustomerAccountAdd”。
这是模块的相关代码。请问你能帮帮我吗?我是一名 PHP 开发人员,但这是我第一次在 Prestashop 方面进行开发。
/**
* Don't forget to create update methods if needed:
* http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
*/
public function install()
{
return parent::install()
&& $this->createRequiredDBTables()
&& $this->registerHook('actionCustomerAccountAdd');
}
我有这个代码来检查日志文件或页面,但它没有被触发:
public function hookActionCustomerAccountAdd($params)
{
$this->logger->info('Hook action customer account add fired');
echo 'hook fired';
die();
}
谢谢你。