Prestashop 1.6 在产品页面上显示制造商描述

Prestashop 1.6 Show manufacturer description on product page

我想在产品页面上显示产品描述。 可以更改 product.tpl 来显示吗?是否需要开发模块或更改核心类?

要在产品页面上显示制造商说明,最好的方法是创建对 ProductController 的覆盖,例如:

class ProductController extends ProductControllerCore
{
    public function initContent(){

        $manufacturer_description = "";
        if($this->product->id_manufacturer > 0)
        {
            $manufacturer = new Manufacturer($this->product->id_manufacturer, $this->context->language->id);
            $manufacturer_description = $manufacturer->description;
        }

        $this->context->smarty->assign('manufacturer_description', $manufacturer_description);

        parent::initContent();
    }
}

然后在主题的 product.tpl 中将 {$manufacturer_description} 放在您想要显示的位置。

不要忘记清除缓存,并在这些更改生效后删除文件cache/class_index。php。