Post by gergovprint » Sun Jun 08, 2014 8:29 am

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
   <id><![CDATA[Hidden]]></id>
   <version><![CDATA[1.0.0]]></version>
   <vqmver><![CDATA[2.4.1]]></vqmver>
   <author><![CDATA[bgd]]></author>
   <file name="admin/view/template/catalog/product_form.tpl">
        <operation>
            <search position="replace">
            <![CDATA[<?php echo $entry_sku; ?>]]>
         </search>
            <add>
            <![CDATA[]]>
         </add>
        </operation>
      <operation>
            <search position="replace">
            <![CDATA[<input type="text" name="sku" value="<?php echo $sku; ?>" />]]>
         </search>
            <add>
            <![CDATA[
            <input type="hidden" name="sku" value="<?php echo $sku; ?>" />
            ]]>
         </add>
        </operation>
so make the code work, but remains blank <tr> ></tr>
Can you help me, what should I do
Last edited by gergovprint on Sun Jun 08, 2014 9:31 pm, edited 1 time in total.

метални табели отпечатване на флаери отпечатване на винил отпечатване на плакати


New member

Posts

Joined
Wed Apr 28, 2010 10:03 pm


Post by labeshops » Sun Jun 08, 2014 9:15 am

Instead of hidden, use display: none; as it removes the space as well.

Try

Code: Select all

    <?xml version="1.0" encoding="UTF-8"?>
    <modification>
       <id><![CDATA[Hidden]]></id>
       <version><![CDATA[1.0.0]]></version>
       <vqmver><![CDATA[2.4.1]]></vqmver>
       <author><![CDATA[bgd]]></author>
       <file name="admin/view/template/catalog/product_form.tpl">
            <operation>
                <search position="replace">
                <![CDATA[<?php echo $entry_sku; ?>]]>
             </search>
                <add>
                <![CDATA[]]>
             </add>
            </operation>
          <operation>
                <search position="replace">
                <![CDATA[<input type="text" name="sku" value="<?php echo $sku; ?>" />]]>
             </search>
                <add>
                <![CDATA[
                <input style="display:none;" name="sku" value="<?php echo $sku; ?>" />
                ]]>
             </add>
            </operation>

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by gergovprint » Sun Jun 08, 2014 9:27 am

I tried ... your code ... does not work

Attachments

Untitled-1.jpg

Untitled-1.jpg (42.51 KiB) Viewed 2669 times


метални табели отпечатване на флаери отпечатване на винил отпечатване на плакати


New member

Posts

Joined
Wed Apr 28, 2010 10:03 pm


Post by gergovprint » Sun Jun 08, 2014 8:27 pm

solve the problem
<file name="admin/view/template/catalog/product_form.tpl">
<operation>
<search position="replace">
<![CDATA[<td><?php echo $entry_sku; ?></td> ]]>
</search>
<add>
<![CDATA[]]>
</add>
</operation>
<operation>
<search position="replace">
<![CDATA[<td><input type="text" name="sku" value="<?php echo $sku; ?>" /></td> ]]>
</search>
<add>
<![CDATA[
<input style="display:none;" name="sku" value="<?php echo $sku; ?>" />
]]>
</add>
</operation>
</file>

But I want to remove and "Subtract Stock:" , "Requires Shipping:", "Tax Class:" , ..................but ... I can not handle it, please help


in folder: admin/view/template/catalog/product_form.tpl"
how can I hide this field in admin panel with VQMOD
I made several attempts, but unfortunately were unsuccessful


Code: Select all

            <tr>
              <td><?php echo $entry_shipping; ?></td>
              <td><?php if ($shipping) { ?>
                <input type="radio" name="shipping" value="1" checked="checked" />
                <?php echo $text_yes; ?>
                <input type="radio" name="shipping" value="0" />
                <?php echo $text_no; ?>
                <?php } else { ?>
                <input type="radio" name="shipping" value="1" />
                <?php echo $text_yes; ?>
                <input type="radio" name="shipping" value="0" checked="checked" />
                <?php echo $text_no; ?>
                <?php } ?></td>
            </tr>
            <tr>

метални табели отпечатване на флаери отпечатване на винил отпечатване на плакати


New member

Posts

Joined
Wed Apr 28, 2010 10:03 pm


Post by Qphoria » Tue Jun 10, 2014 12:16 am

First find the "unique" part of the block... something that isn't reproduced anywhere else in the file. For that section you can use:

Code: Select all

<td><?php echo $entry_shipping; ?></td>
Note that "removing" these tags will in turn cause havoc on the php side when those fields are expected by the database calls but not there. So instead you should "hide" these tags by simply adding
style="display:none;" to the parent <tr> tag.

This is slightly trickier to accomplish with just php altering because html is very ambiguous with all the plain <tr> tags out there. So we'll use javascript instead to find the parent by traversing the DOM with jquery. First we need to change the entry <td> to something more unique that jquery can trigger on. This will actually be even better because we can use a class that will match ALL areas you want to hide with a single javascript call.

Code: Select all

<file name="admin/view/template/catalog/product_form.tpl">

	<operation>
		<search position="replace"><![CDATA[
			<td><?php echo $entry_shipping; ?></td>
		]]></search>
		<add trim="false"><![CDATA[
			<td class="hide_my_daddy"><?php echo $entry_shipping; ?></td>
		]]><add>
	</operation>

	<operation>
		<search position="replace"><![CDATA[
			<?php echo $footer; ?>
		]]></search>
		<add trim="false"><![CDATA[
			<script type="text/javascript">$('.hide_my_daddy').parent().hide();</script>
			<?php echo $footer; ?>
		]]><add>
	</operation>

</file>
Add a new operation block to add the class="hide_my_daddy" for each <tr> block you want to hide.

What might be beneficial is if we added negative number support for offset to the vqmod engine, so that you could do

Code: Select all

    <search position="replace" offset="-1">
or some other method like that
But that doesn't exist at the moment.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 70 guests