简体   繁体   中英

How to specify what files to ignore in a 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM