我已经为opencart创建了一个模块。现在我必须更改一些默认模板文件和php文件,所以我使用 VQMOD 。现在 VQMOD管理器正在运行但不是添加我添加的脚本。
以下示例代码。
<modification>
<id>demo</id>
<version>1.1</version>
<vqmver>2.3.0</vqmver>
<author>http://www.demo.com</author>
<file path="admin/controller/common/" name="header.php">
<operation>
<search position="after">
<![CDATA[$this->data['text_zone'] = $this->language->get('text_zone');]]>
</search>
<add>
<![CDATA[
$this -> data['text_design_category'] = $this -> language -> get('text_design_category');
$this -> data['text_rawproduct'] = $this -> language -> get('text_rawproduct');
$this -> data['text_font'] = $this -> language -> get('text_font');
$this -> data['text_color'] = $this -> language -> get('text_color');
$this -> data['text_screen_color'] = $this -> language -> get('text_screen_color');
$this -> data['text_productdesigner'] = 'Product Designer';
]]>
</add>
</operation>
</file>
</modification>
答案 0 :(得分:0)
您只需要替换此行<file name="admin/controller/common/header.php">
而不是<file path="admin/controller/common/" name="header.php">
请尝试以下代码。
<modification>
<id>demo</id>
<version>1.1</version>
<vqmver>2.3.0</vqmver>
<author>http://www.demo.com</author>
<file name="admin/controller/common/header.php">
<operation>
<search position="after">
<![CDATA[$this->data['text_zone'] = $this->language->get('text_zone');]]>
</search>
<add>
<![CDATA[
$this -> data['text_design_category'] = $this -> language -> get('text_design_category');
$this -> data['text_rawproduct'] = $this -> language -> get('text_rawproduct');
$this -> data['text_font'] = $this -> language -> get('text_font');
$this -> data['text_color'] = $this -> language -> get('text_color');
$this -> data['text_screen_color'] = $this -> language -> get('text_screen_color');
$this -> data['text_productdesigner'] = 'Product Designer';
]]>
</add>
</operation>
</file>
</modification>