Prestashop 1.7 hookDisplayAdminProductsExtra不工作?
我正在使用hookDisplayAdminProductsExtra挂钩。这是工作1.6 prestashop版本。但对于1.7不起作用。Prestashop 1.7 hookDisplayAdminProductsExtra不工作?
这里是我的代码
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');
}
一个screenshoot但是,当我安装我的插件的Prestashop 1.7版我有一些关于问题Admin产品Extra hook这里是一个截图,从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;
}
这个挂钩用于前端的额外产品内容,而不是后端-办公室 – ArisS
但为什么要使用1.7版?是的,他们说这是稳定和可用的,但它不,相信我... – sarcom
我只是想让我的模块稳定为1.7 – user5510975