在 prestashop 中覆盖帮助列表页脚
Override helper list footer in prestashop
我想批量更改管理产品操作,所以我正在创建一个模块来完成此操作,
在我的模块中,我没有任何控制器,我正在覆盖 adminProductsController,我想覆盖 ADMIN/themes/default/template/helpers/list/footer_list.tpl,我试图将它放在 /override/controllers/admin/templates/helpers/list 下,但我得到的是默认值模板。
在Helper.php
public function createTemplate($tpl_name)
{
var_dump($this->override_folder);
var_dump($this->module);
exit;
if ($this->override_folder)
{
if ($this->context->controller instanceof ModuleAdminController)
$override_tpl_path = $this->context->controller->getTemplatePath().$this->override_folder.$this->base_folder.$tpl_name;
elseif ($this->module)
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->override_folder.$this->base_folder.$tpl_name;
else
{
if (file_exists($this->context->smarty->getTemplateDir(1).$this->override_folder.$this->base_folder.$tpl_name))
$override_tpl_path = $this->context->smarty->getTemplateDir(1).$this->override_folder.$this->base_folder.$tpl_name;
elseif (file_exists($this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$this->base_folder.$tpl_name))
$override_tpl_path = $this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$this->base_folder.$tpl_name;
}
}
elseif ($this->module)
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->base_folder.$tpl_name;
我得到 $this->override_folder 的 NULL,我试过了
$helper->override_folder = $this->tpl_folder;
在AdminController.php中,renderList函数。
有人可以帮忙吗?
谢谢。
我通过在 override/controllers/admin/templates/products/helpers/list
中添加文件解决了问题
我想批量更改管理产品操作,所以我正在创建一个模块来完成此操作, 在我的模块中,我没有任何控制器,我正在覆盖 adminProductsController,我想覆盖 ADMIN/themes/default/template/helpers/list/footer_list.tpl,我试图将它放在 /override/controllers/admin/templates/helpers/list 下,但我得到的是默认值模板。
在Helper.php
public function createTemplate($tpl_name)
{
var_dump($this->override_folder);
var_dump($this->module);
exit;
if ($this->override_folder)
{
if ($this->context->controller instanceof ModuleAdminController)
$override_tpl_path = $this->context->controller->getTemplatePath().$this->override_folder.$this->base_folder.$tpl_name;
elseif ($this->module)
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->override_folder.$this->base_folder.$tpl_name;
else
{
if (file_exists($this->context->smarty->getTemplateDir(1).$this->override_folder.$this->base_folder.$tpl_name))
$override_tpl_path = $this->context->smarty->getTemplateDir(1).$this->override_folder.$this->base_folder.$tpl_name;
elseif (file_exists($this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$this->base_folder.$tpl_name))
$override_tpl_path = $this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$this->base_folder.$tpl_name;
}
}
elseif ($this->module)
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->base_folder.$tpl_name;
我得到 $this->override_folder 的 NULL,我试过了
$helper->override_folder = $this->tpl_folder;
在AdminController.php中,renderList函数。
有人可以帮忙吗? 谢谢。
我通过在 override/controllers/admin/templates/products/helpers/list
中添加文件解决了问题