我已按如下方式覆盖ProductController.php以显示manufactere国家/地区。
class ProductController extends ProductControllerCore
{
public function initContent()
{
$manufacturer_country = "";
if($this->product->id_manufacturer > 0)
{
$manufacturer = new Manufacturer($this->product->id_manufacturer, $this->context->language->id);
$manufacturer_country = $manufacturer->country;
}
$this->context->smarty->assign('manufacturer_country', $manufacturer_country);
parent::initContent();
}
}
在product.tpl我写了{$ manufacturer_country}但没有打印。任何人都可以指导我如何在product.tpl和product-list.tpl上打印
答案 0 :(得分:0)
覆盖控制器
该文件可以放在以下任一位置:
/override/controllers/front/ProductController.php
/modules/my_module/override/controllers/front/ProductController.php
/themes/prestashop/modules/my_module/my_module.tpl
/themes/prestashop/css/modules/my_module/my_module.css
/themes/prestashop/js/modules/my_module/my_module.js
您需要根据1.6版本的要求调整您的上下文路径。此致