我试图在自定义模块中添加一个挂钩,但是在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();
}
谢谢。