[英]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.