2017-06-06 100 views

回答

0

是的,可以在自定义页面上显示PrestaShop产品。您首先必须通过模块创建一个前端控制器,如下所示。

你需要你的模块在以下路径中创建一个单独的控制器:

/modules/supercheckout/controllers/front/fcont.php(其中supercheckout是你的模块名)

和写下面的代码文件中:

class SupercheckoutFcontModuleFrontController extends ModuleFrontController 
{ 

public function initContent() 
{ 
     parent::initContent(); 
     $this->setTemplate('template_file.tpl'); 
} 
} 

然后在您的模块的模板文件为主题的产品list.tpl文件列出的产品在你的控制器页面上。

{include file="$tpl_dir./product-list.tpl" products=$filtered_products id='block_list_id'} 

注意:$ filtered_products变量包含要在自定义控制器页面上加载的产品。

+0

嗨,谢谢你的回答, –

+0

你能解释为什么我必须通过一个模块吗? –

相关问题