在prestashop 1.4上使用钩子updateQuantity

哈利勒10

我是prestashop的新手。

我正在使用prestashop 1.4,我想在更新库存后调用一个事件。我读过一些有关updateQuantity挂钩或其他已定义挂钩动作的主题。有人可以通过一个简单的例子将我带入正确的道路

谢谢

埃德加

您可以使用动作hookUpdateQuantity如果要首先在模块上使用此操作,则必须在为此钩子创建函数之后在模块函数install()上注册

public function install()
{
  return parent::install() && $this->registerHook('updateQuantity');
}

public function hookUpdateQuantity($params)
{
   // for example send Customer Alert information about product quantity 
    if ($this->_customer_qty && $params['product']['quantity'] > 0)
        $this->sendCustomerAlert((int)$params['product']['id'], 0);
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章