ocmod不会覆盖文件

时间:2016-01-31 14:59:31

标签: xml opencart

我在使用ocmode在opencart 2上安装扩展时出现问题。该文件确实上传并且Opencart sais安装了该模块。但它不起作用。该模块必须按类别显示产品代码。文件不会被覆盖。这是xml

google.maps.event.addListener(marker,'click',function() {
   // do stuff
});

和日志输出

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Articles2</name>
    <code>article2</code>
    <version>1.0.0</version>
    <vqmver></vqmver>
    <author>Bogdan</author>
    <date>2016.01.31</date>

    <file path="catalog/controller/product/category.php">
        <operation>
            <search>'name'        => $result['name'],</search>
            <add position="before">'model'        => $result['model'],</add>
        </operation>


    </file>
        <file path="catalog/view/theme/default/template/product/category.tpl">
        <operation>
            <search>&lt;p><?php echo $product['description']; ?>&lt;/p></search>
            <add position="before">&lt;h3>product code:&lt;/h3>    &lt;h4><?php echo $product['model']; ?>&lt;/h4></add>
        </operation>
    </file>




</modification>

这段代码可能出现什么问题?

1 个答案:

答案 0 :(得分:0)

好吧,我找到了答案。在搜索和添加标签时我不得不使用[CDATA]这是一个xml:

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Articles2</name>
    <code>article2</code>
    <version>1.0.0</version>
    <vqmver></vqmver>
    <author>Bogdan</author>
    <date>2016.01.31</date>

    <file path="catalog/controller/product/category.php">
        <operation>
            <search><![CDATA['name'        => $result['name'],]]></search>
            <add position="before"><![CDATA['model'        => $result['model'],]]></add>
        </operation>


    </file>
        <file path="catalog/view/theme/default/template/product/category.tpl">
        <operation>
            <search><![CDATA[<p><?php echo $product['description']; ?></p>]]></search>
            <add position="before"><![CDATA[<h3>product code:</h3>    <h4><?php echo $product['model']; ?></h4>]]></add>
        </operation>
    </file>




</modification>