dongtu0088 2016-04-18 09:24
浏览 85
已采纳

如何在vQmod中指定要忽略的文件 - Opencart 1.5

I am working on a payment module for an OpenCart 1.5 site, but there is a vQmod installed that adds a table row with an option for all payment modules. However, the way the vQmod is set up is such that it add these rows just before the </table> tag but because there are two tables on my payment module settings page, it adds the row twice.

<file name="admin/view/template/payment/*.tpl">
    <operation error="skip">
        <search position="before" index="1"><![CDATA[
            </table>
        ]]></search>
        <ignoreif><![CDATA[
            Braintree Payment Gateway v156.4
        ]]></ignoreif>
        <add><![CDATA[
            <tr>
                <td><?php echo $entry_paid_status; ?></td>
                <td>
                    <?php if ($field_value) { ?>
                        <input type="radio" name="<?php echo $classname; ?>_paid_status" value="1" checked="checked" /><?php echo $text_paid; ?>
                        <input type="radio" name="<?php echo $classname; ?>_paid_status" value="0" /><?php echo $text_unpaid; ?>
                    <?php } else { ?>
                        <input type="radio" name="<?php echo $classname; ?>_paid_status" value="1" /><?php echo $text_paid; ?>
                        <input type="radio" name="<?php echo $classname; ?>_paid_status" value="0" checked="checked" /><?php echo $text_unpaid; ?>
                    <?php } ?>
                </td>
            </tr>
        ]]></add>
    </operation>

    ...

</file>

Basically, it adds a row for something called 'Paid Status' - which isn't really needed for my payment module, but it's not a problem if it is added - but since it adds it before </table> and my module has this tag twice, it gets added twice.

I have noticed the <ignoreif> tag - but I'm not sure how this works (I'm not overly familiar with vQmods) I tried adding the name of my payment module in there, but it makes no difference.

Basically what I'm asking is, is there any way to exclude this code from being added to my module? Before anyone suggests, I can't take out the tables, they are needed for this page.

Thank you

  • 写回答

1条回答 默认 最新

  • doumengwei0138 2016-04-18 09:40
    关注

    ignoreif is used to ignore an operation if the code/string in ignoreif tag is found in file.

    Please find the below sample code:

    <modification>
        <id><![CDATA[###Description/Title###]]></id>
        <version><![CDATA[###Our code version (Usually specifies plugin/extension version)###]]></version>
        <vqmver><![CDATA[###Vqmod version###]]></vqmver>
        <author><![CDATA[###Author's Name###]]></author>
        <file path="###Folder path###" name="###File name###" >
            <operation info="###Operation Info###" >
                <search position="###Search/Replace filter###" offset="0">    
                    <![CDATA[###Search Code###]]>
                </search>
                <ignoreif regex="false" ><![CDATA[
                    ###Add Code###
                ]]></ignoreif>
                <add><![CDATA[
                    ###Add Code###
                ]]></add>
            </operation>
        </file>
    </modification> 
    

    Reference url: Opencart: Vqmod tutorial

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c