0

我已经为 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>
4

1 回答 1

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>
于 2014-05-13T11:36:17.363 回答