2016-01-31 151 views
0

我使用ocmode在opencart 2上安裝擴展的問題。該文件確實上傳並安裝了Opencart。但它不起作用。該模塊必須按類別顯示產品代碼。文件不會被覆蓋。這裏是XMLocmod不會覆蓋文件

<?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> 

和日誌輸出

2016-01-31 15:48:48 - MOD: Modification Default 
FILE: system/engine/action.php 
REGEX: ~(require|include)(_once)?\(([^)]+)~ 
LINE: 39 
FILE: system/engine/loader.php 
REGEX: ~(require|include)(_once)?\(([^)]+)~ 
LINE: 20 
LINE: 59 
LINE: 80 
LINE: 99 
FILE: system/library/config.php 
REGEX: ~(require|include)(_once)?\(([^)]+)~ 
LINE: 23 
FILE: system/library/language.php 
REGEX: ~(require|include)(_once)?\(([^)]+)~ 
LINE: 25 
LINE: 31 
---------------------------------------------------------------- 
MOD: Articles2 
FILE: catalog/controller/product/category.php 
CODE: 'name'  => $result['name'], 
LINE: 216 
FILE: catalog/view/theme/default/template/product/category.tpl 
CODE: <p></p> 
NOT FOUND! 
---------------------------------------------------------------- 

什麼posibly可能出錯,這代碼?

回答

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>