簡體   English   中英

在 ocmod opencart v2 中找不到錯誤代碼

[英]error code not found in ocmod opencart v2

我正在嘗試在 opencart v2.0 上使用 ocmod 替換文件中所有代碼行的准確性。 這是我的修改:

 <file path="admin/view/template/sale/order_form.tpl">
    <operation>

    <search ><![CDATA[
   if (option['type'] == 'select' || option['type'] == 'radio' || option['type'] == 'image') {
                    html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + ']" value="' + option['product_option_value_id'] + '" />';
                  }
]]></search>
    <add position="replace"><![CDATA[
 if (option['type'] == 'select' || option['type'] == 'radio' || option['type'] == 'image'||option['type']=='input_qty') {
                    html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + ']" value="' + option['product_option_value_id'] + '" />';
                  }
]]></add>
    </operation>






  </file>

唯一的問題是在 ocmoderror.log 中它說找不到該行。 盡管在 IDE 中我可以看到這行代碼。 什么會導致這個? 這就是我在 ocmoderror.log 中看到的

FILE: admin/view/template/sale/order_form.tpl
CODE: if (option['type'] == 'select' || option['type'] == 'radio' || option['type'] == 'image') {
NOT FOUND!

不要在搜索標簽的開始和字符串的結尾留下空格,並復制與核心文件中完全相同的代碼。 應該是這樣的:

<search><![CDATA[if (option['type'] == 'select' || option['type'] == 'radio' || option['type'] == 'image') {
                    html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + ']" value="' + option['product_option_value_id'] + '" />';
                  }]]></search>

嘗試...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM