首页 文章

Prestashop 1.7 hookDisplayAdminProductsExtra不工作?

提问于
浏览
0

我正在使用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
enter image description here
的截图

但是,当我安装我的插件prestashop版本1.7我有一些关于管理产品的问题额外钩这里是从1.7截图

enter image description here

新选项卡是模块选项名称,它不会听到产品选项菜单 . hookDisplayAdminProductsExtra更改了新版本?我该怎么办?

谢谢 .

2 回答

  • 0

    简单:

    public function hookdisplayProductExtraContent($params)
    {        
        $array = array();
        $array[] = (new PrestaShop\PrestaShop\Core\Product\ProductExtraContent())
                ->setTitle('tittle')
                ->setContent('content'));
        return $array;
    }
    
  • 5

    在PrestaShop 1.7中,他们更改了hookDisplayAdminProductsExtra挂钩的逻辑,现在使用此挂钩的所有模块将显示在名为“模块选项”的单个选项卡中,而不是每个模块的单独选项卡 . 这意味着您无法在PrestaShop 1.7中为您的模块显示单独的选项卡

    有关PrestaShop中钩子的更多详细信息,请访问以下链接:

    http://build.prestashop.com/news/module-development-changes-in-17/

相关问题