Post by HAO » Thu Apr 27, 2017 12:16 pm

I want to delete the specified code via ocmod, I just read the Modification-System description is not understanding.

May I ask if I want to delete the full code for a particular file, how do I write it?

Like it is:

Code: Select all

              <?php foreach ($vouchers as $vouchers) { ?>
              <tr>
                <td></td>
                <td class="text-left"><?php echo $vouchers['description']; ?></td>
                <td class="text-left"></td>
                <td class="text-left"><div class="input-group btn-block" style="max-width: 200px;">
                    <input type="text" name="" value="1" size="1" disabled="disabled" class="form-control" />
                    <span class="input-group-btn"><button type="button" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger" onclick="voucher.remove('<?php echo $vouchers['key']; ?>');"><i class="fa fa-times-circle"></i></button></span></div></td>
                <td class="text-right"><?php echo $vouchers['amount']; ?></td>
                <td class="text-right"><?php echo $vouchers['amount']; ?></td>
              </tr>
              <?php } ?>
Last edited by HAO on Sun Apr 30, 2017 7:48 pm, edited 1 time in total.

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by IP_CAM » Sun Apr 30, 2017 1:25 am

Well, you better just remove, or at least REM OUT the entire Section, to get it 'hidden', by use of
either:
<!-- SECTION TO HIDE -->
or:
/* SECTION TO HIDE */
one of them will work, I am just never quite sure, wich one... :D
It really makes no sense, trying to write a VqMod/Ocmod, to remove the entire section,
as soon as you add another Mod, i.E. adding a single </tr> Tag in the same pages, it could kill part of
or even the entire 'construction' again. ;)
Good Luck!
Ernie

Code: Select all

<!-- <?php foreach ($vouchers as $vouchers) { ?>
              <tr>
---
---
---
<td class="text-right"><?php echo $vouchers['amount']; ?></td>
              </tr>
              <?php } ?>
-->
or so:

Code: Select all

/* <?php foreach ($vouchers as $vouchers) { ?>
              <tr>
---
---
---
<td class="text-right"><?php echo $vouchers['amount']; ?></td>
              </tr>
              <?php } ?>
*/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by artcore » Sun Apr 30, 2017 2:12 am

A hint to how you can do it. Use the ocmod documentation to implement.
It helps to know php; here, I just reset the vouchers array before it loops.

Patience and persistence will eventually make it work ;D

search: <?php foreach ($vouchers as $vouchers) { ?>

add position=replace: <?php $vouchers=array(); foreach ($vouchers as $vouchers) { ?>

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by IP_CAM » Sun Apr 30, 2017 4:35 am

well, that's, what always makes me feeling so low ... :-[
but otherwhise, I would never have known OC, I would have built my own.
Ernie :D

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by HAO » Sun Apr 30, 2017 8:07 am

I just want to say, I know how to delete or hide the whole.

But i want to make an extension, I can not directly edit someone else's store site?

In addition I was really curious, there is no complete search with replace the instruction.

If there is no such thing, forget it.

Thank you for your reply!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by pprmkr » Sun Apr 30, 2017 2:44 pm

HAO wrote:
Thu Apr 27, 2017 12:16 pm
May I ask if I want to delete the full code for a particular file, how do I write it?
Use attribute 'index="number"'

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>Modification Default</name>
    <version>1.0</version>
    <author>OpenCart Ltd</author>
    <link>http://www.opencart.com</link>
    <file path="catalog/view/theme/default/product/product.tpl">
        <operation>
            <search><![CDATA[
            <?php foreach ($vouchers as $vouchers) { ?>
            ]]></search>
            <add position="replace" offset="12"><![CDATA[
            <!-- Removed by OCMod -->
            ]]></add>
        </operation>
    </file>  
</modification>

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by HAO » Sun Apr 30, 2017 7:47 pm

Thank you for your reply!

This is the answer I want, The problem has been solved!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 3 guests