有人可以帮助我向opencart
中的制造商添加元数据详细信息吗?我正在寻找添加类似于产品或类别的元数据关键字,描述和制造商描述。
答案 0 :(得分:1)
打开您的opencart数据库,并将以下额外字段添加到// if the result is empty, the generated code does not exist in database. So it can be used.
while(result.length != 0){
var result = conn.query("SELECT * FROM user WHERE code = abc");
}
表中
oc_manufacturer
编辑制造商控制器文件和以下代码
编辑文件:catalog / controller / product / manufacturer.php
查找代码:
ALTER TABLE oc_manufacturer ADD COLUMN `description` text NOT NULL;
ALTER TABLE oc_manufacturer ADD COLUMN `meta_title` varchar(255) NOT NULL;
ALTER TABLE oc_manufacturer ADD COLUMN `meta_description` varchar(255) NOT NULL;
ALTER TABLE oc_manufacturer ADD COLUMN `meta_keyword` varchar(255) NOT NULL;
用以下代码替换以下代码:
$this->document->setTitle($manufacturer_info['name']);
现在编辑制造商产品的查看文件
编辑文件:目录/视图/主题/ [活动主题] /template/product/manufacturer_info.twig
在要放置制造商描述的位置添加描述变量
$this->document->setTitle($manufacturer_info['meta_title']);
$this->document->setDescription($manufacturer_info['meta_description']);
$this->document->setKeywords($manufacturer_info['meta_keyword']);
$data['description'] = $manufacturer_info['description'];
注意:通过点击管理面板扩展->修改页面中的刷新按钮来刷新修改
现在将您的描述和元数据添加到{{ description }}
表中