我正在编写一个模块,我知道如何构建一个全局模块,但我想做以下事情:
拥有全球属性(已涵盖)
在管理员的产品界面的选项卡中具有相同的属性,用户可以覆盖全局属性(仍有待执行)
现在我的问题:
如何在prestashop管理员的产品界面中添加其他选项卡?
我想我可以轻松地在我的模块模板中调用这些并检查全局是否被覆盖?
感谢您的反馈,Eric
PS . 使用prestashop 1.5.8,稍后会担心扩展到1.6
要向产品编辑页面添加其他选项卡,可以使用hookDisplayAdminProductsExtra .
首先,您必须在install()方法中注册此钩子:
public function install() { ... $this->registerHook('displayAdminProductsExtra')... ... }
之后你定义了这个:
public function hookDisplayAdminProductsExtra($params) { ... return $this->display(__FILE__, 'views/admin/yourtemplatefile.tpl'); }
文件yourtemplatefile.tpl定义额外选项卡的内容 . 可以在hookDisplayAdminProductsExtra函数内分配此文件中使用的额外变量
在这里您可以找到有关创建模块的其他信息:http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module
在这里你可以找到有关钩子的信息:http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5
1 回答
要向产品编辑页面添加其他选项卡,可以使用hookDisplayAdminProductsExtra .
首先,您必须在install()方法中注册此钩子:
之后你定义了这个:
文件yourtemplatefile.tpl定义额外选项卡的内容 . 可以在hookDisplayAdminProductsExtra函数内分配此文件中使用的额外变量
在这里您可以找到有关创建模块的其他信息:http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module
在这里你可以找到有关钩子的信息:http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5