如何在prestashop中使用模板视图?

如何在prestashop中使用模板视图?,prestashop,prestashop-1.7,Prestashop,Prestashop 1.7,我想使用prestashop(product list.tpl)中的现有模板,我在模块控制器中使用以下代码(方法:initContent()): 但是prestashop会把这个错误告诉我: [PrestaShopException] No template found for C:\wamp64\www\prestashop/themes/classic/templates/catalog/listing/product-list.tpl at line 68 in file classes/

我想使用prestashop(product list.tpl)中的现有模板,我在模块控制器中使用以下代码(方法:initContent()):

但是prestashop会把这个错误告诉我:

[PrestaShopException]
No template found for C:\wamp64\www\prestashop/themes/classic/templates/catalog/listing/product-list.tpl
at line 68 in file classes/Smarty/TemplateFinder.php

非常感谢你的帮助

问题在于方法setTemplate(),它调用getTemplatePath(),该方法检查所需模板是否位于模块目录或当前主题内的模块目录中

要使其正常工作,我只需将
产品列表.tpl
复制到目录中:
“YourTheme”/modules/“Your module”/views/templates/front/

您好,谢谢您的回答,我尝试了您的代码,但我遇到了相同的问题:
在文件类/Smarty/TemplateFinder.php的第68行没有找到C:\wamp64\www\prestashop/themes/classic/product-list.tpl的模板,你能试试吗?看看我的新答案
[PrestaShopException]
No template found for C:\wamp64\www\prestashop/themes/classic/templates/catalog/listing/product-list.tpl
at line 68 in file classes/Smarty/TemplateFinder.php