简体   繁体   English

Prestashop 1.7 hookDisplayAdminProductsExtra不起作用?

[英]Prestashop 1.7 hookDisplayAdminProductsExtra is not working?

I'm using the hookDisplayAdminProductsExtra hook. 我正在使用hookDisplayAdminProductsExtra挂钩。 It's work 1.6 prestashop version. 它是工作1.6 prestashop版本。 But for 1.7 don't work. 但是对于1.7不起作用。

Here is the my codes 这是我的密码

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');
}

This codes working for prestshop 1.6 here is a screenshoot from 1.6 此代码适用于prestshop 1.6,此处是1.6的屏幕截图 在此处输入图片说明

But when i install the my plugin prestashop version 1.7 i have a some problems about Admin Products Extra hook here is a screenshot from 1.7 但是,当我安装插件prestashop 1.7版时,我对管理产品有一些问题。额外的钩子是1.7的屏幕截图

在此处输入图片说明

New tab is come to module options name and its not hear the product options menu. 新选项卡位于模块选项名称中,无法听到产品选项菜单。 hookDisplayAdminProductsExtra is changed new version? hookDisplayAdminProductsExtra是否已更改为新版本? How can i fix 我该如何解决

Thanks. 谢谢。

In PrestaShop 1.7 they have changed the logic for hookDisplayAdminProductsExtra hook, now all the modules using this hook will be displayed in a single tab named 'Module Options' instead of a separate tab for each module. 在PrestaShop 1.7中,他们更改了hookDisplayAdminProductsExtra挂钩的逻辑,现在使用该挂钩的所有模块将显示在名为“模块选项”的单个选项卡中,而不是每个模块的单独选项卡。 That means you can't show a separate tab for your module in PrestaShop 1.7 这意味着您无法在PrestaShop 1.7中显示模块的单独选项卡

For more details about the hooks in PrestaShop you can visit the following link: 有关PrestaShop中的挂钩的更多详细信息,您可以访问以下链接:

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

Simple: 简单:

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM