[英]Prestashop 1.7 hookDisplayAdminProductsExtra is not working?
我正在使用hookDisplayAdminProductsExtra挂钩。 它是工作1.6 prestashop版本。 但是对于1.7不起作用。
这是我的密码
public function hookDisplayAdminProductsExtra($params)
{
$this->smarty;
$id_product = Tools::getValue('id_product');
$get_values = $this->getProductCurrencyRow($id_product);
$this->smarty->assign('get_values',$get_values);
$this->smarty->assign('id_product',$id_product);
$currencies = $this->getDefaultRates();
$this->smarty->assign('currencies',$currencies);
return $this->display(__FILE__, '/views/templates/admin/productcurrency.tpl');
}
此代码适用于prestshop 1.6,此处是1.6的屏幕截图
但是,当我安装插件prestashop 1.7版时,我对管理产品有一些问题。额外的钩子是1.7的屏幕截图
新选项卡位于模块选项名称中,无法听到产品选项菜单。 hookDisplayAdminProductsExtra是否已更改为新版本? 我该如何解决
谢谢。
在PrestaShop 1.7中,他们更改了hookDisplayAdminProductsExtra挂钩的逻辑,现在使用该挂钩的所有模块将显示在名为“模块选项”的单个选项卡中,而不是每个模块的单独选项卡。 这意味着您无法在PrestaShop 1.7中显示模块的单独选项卡
有关PrestaShop中的挂钩的更多详细信息,您可以访问以下链接:
http://build.prestashop.com/news/module-development-changes-in-17/
简单:
public function hookdisplayProductExtraContent($params)
{
$array = array();
$array[] = (new PrestaShop\PrestaShop\Core\Product\ProductExtraContent())
->setTitle('tittle')
->setContent('content'));
return $array;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.