Post by olimax » Fri Dec 23, 2011 6:33 pm

Quick vQmod to Remove all 'Add to Compare' links
Tested on 1.5.1.3
Obviously you have to change 'default' to your theme if you are using a different one
I think I have caught all instances. Let me know if not.

Remove Add to Compare for 1.5.1.3

Code: Select all

<modification>

	<id>Remove Add to Compare</id>
	<version>1.0.0</version>
	<vqmver>1.2.3</vqmver>
	<author>Olimax</author>

	<file name="catalog/view/theme/default/template/product/category.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[ ]]>
            </add>
        </operation>
	</file>

	<file name="catalog/view/theme/default/template/product/manufacturer_info.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[ ]]>
            </add>
        </operation>
	</file>
	
	<file name="catalog/view/theme/default/template/product/product.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a>]]>
            </search>
            <add>
            	<![CDATA[ ]]>
            </add>
        </operation>
        
        <operation>
            <search position="replace">
            	<![CDATA[<a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />]]>
            </search>
            <add>
            	<![CDATA[<span><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a></span>]]>
            </add>
        </operation>        
          
	</file>
	
	<file name="catalog/view/theme/default/template/product/search.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[ ]]>
            </add>
        </operation>
	</file>
	
	<file name="catalog/view/theme/default/template/product/special.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[ ]]>
            </add>
        </operation>
	</file>      
	
		
</modification>
Last edited by olimax on Sat Jan 21, 2012 6:35 am, edited 1 time in total.

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by Wallimann » Mon Jan 02, 2012 4:53 pm

Nice job.
I have a problem though, when applying this instead of removing the "add to compare" I get a "null" text...
Any idea?

Guitar Backing Tracks and Video Lessons at http://www.guitarplayback.com


New member

Posts

Joined
Fri Oct 29, 2010 1:38 am
Location - Colorado

Post by stewiek » Tue Jan 03, 2012 2:41 pm

same here, it does removed the "add to compare" but its replaced by "null"

New member

Posts

Joined
Mon Nov 09, 2009 4:04 pm

Post by olimax » Tue Jan 03, 2012 6:57 pm

Curious.
Try this

Code: Select all

<modification>

	<id>Remove Compare</id>
	<version>1.0.0</version>
	<vqmver>2.1.3</vqmver>
	<author>Olimax</author>

	<file name="catalog/view/theme/default/template/product/category.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[<!-- -->]]>
            </add>
        </operation>
	</file>
	
	
	
	
	<file name="catalog/view/theme/default/template/product/manufacturer_info.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[<!-- -->]]>
            </add>
        </operation>
	</file>
	

	<file name="catalog/view/theme/default/template/product/product.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a>]]>
            </search>
            <add>
            	<![CDATA[<!-- -->]]>
            </add>
        </operation>
        
        <operation>
            <search position="replace">
            	<![CDATA[<a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />]]>
            </search>
            <add>
            	<![CDATA[<span><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a></span>]]>
            </add>
        </operation>        
        
        
	</file>
	
	<file name="catalog/view/theme/default/template/product/search.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[<!-- -->]]>
            </add>
        </operation>
	</file>
	
	<file name="catalog/view/theme/default/template/product/special.tpl">
        <operation>
            <search position="replace">
            	<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
            </search>
            <add>
            	<![CDATA[<!-- -->]]>
            </add>
        </operation>
	</file>      
	
	
		
</modification>
Last edited by olimax on Tue Jan 03, 2012 7:11 pm, edited 1 time in total.

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by olimax » Tue Jan 03, 2012 7:04 pm

Please note this is for vQmod Version 2 if that makes any difference

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by merrydukaan » Sun Jan 08, 2012 6:29 am

olimax wrote:Please note this is for vQmod Version 2 if that makes any difference
Hi, Same 'null' here too.
Another css workaround here: http://forum.opencart.com/viewtopic.php?f=20&t=46951

>>Opencart v1.5.1.3 fresh install, php 5.1.6, Apache/2.2.3 (CentOS)

>> search before you post and [solved] when solved
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)


New member

Posts

Joined
Sun Jan 01, 2012 3:26 pm


Post by olimax » Mon Jan 09, 2012 11:01 am

merrydukaan wrote: Hi, Same 'null' here too.
>>Opencart v1.5.1.3 fresh install, php 5.1.6, Apache/2.2.3 (CentOS)
did you use the updated version above?
where do you see the null?
do you have a live example?

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by merrydukaan » Tue Jan 10, 2012 6:21 pm

Hi Olimax,
Yes, I used the updated version. The null appears on product list page, an example:
http://www.indivineinterest.com/shop/T- ... uman%20Tee

>> search before you post and [solved] when solved
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)


New member

Posts

Joined
Sun Jan 01, 2012 3:26 pm


Post by olimax » Tue Jan 10, 2012 6:54 pm

hmmm
well that has stumped me
as i am just replacing the line with a blank comment I cant see where you are getting that from
it should either find the line and replace iit or not
that looks like a php empty variable

are you running any other vqmods that may interfere with it?
try removing all others (just temporarily stick them all in a subdirectory called REMOVED or something)
do you get any errors in the vqmod logs?

oli

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by merrydukaan » Tue Jan 10, 2012 7:39 pm

Hi
Nope, no other mods.
The last entry I got in the logs with my custom theme on:
Could not resolve path for [catalog/view/theme/shopidi/template/product/category.tpl]
Similarly for: manufacturer_info.tpl, search.tpl, special.tpl. I have copied only product.tpl in my custom folder. But should OC not fallback to defaults?
. . .
Checked with default theme, 'null' again.
The vqmod seems to work on individual product pages although!
No recent errors.
. . .
Copied all those .tpl's to custom folder, 'null' again.
No errors.

>> search before you post and [solved] when solved
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)


New member

Posts

Joined
Sun Jan 01, 2012 3:26 pm


Post by someguy9 » Wed Jan 11, 2012 11:15 pm

I got this working, I'm not going to write the vqmod script for it, but I was getting the null error also. I found if you keep the div it doesnt show the error, so where's what I replaced it with

Code: Select all

<div class="compare"><?php /* <a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a> */ ?></div>

oh.


User avatar
Newbie

Posts

Joined
Wed Jan 11, 2012 11:14 pm
Location - College Park, MD

Post by takahashi1973 » Thu Jan 12, 2012 5:25 am

indeed; the null is caused before you remove the div all togther but ...
it gets "rendered" at the end in function:
function display(view) {

$('.product-grid').attr('class', 'product-list');

$('.product-list > div').each(function(index, element) {
html = '<div class="right">';
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
html += ' <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
html += ' <div class="compare">' + $(element).find('.compare').html() + '</div>';

always possible to extend the search and replace including these lines
//comment it html += ' <div class="compare">' + $(element).find('.compare').html() + '</div>';
but leaving the div empty works too although in some cases you might end up with to much whitespace for instance.

Active Member

Posts

Joined
Thu Oct 13, 2011 11:41 pm

Post by smitch6 » Sat Jan 21, 2012 2:32 am

how does this actually work?
have i got to make my own tpl file from the code above? or just find it somewhere and change it?
thanks

www.pattestersuffolk.co.uk


Active Member

Posts

Joined
Sat Sep 17, 2011 2:46 pm


Post by olimax » Sat Jan 21, 2012 2:41 am

you need to have vQmod installed ( do a search ) - this is a very good thing
then just drop the file into the xml directory XML in vqmod
and Fanny's your aunt
...hopefully

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by smitch6 » Sat Jan 21, 2012 3:07 am

what file????? ??? sorry
so i presume i make my own file from that code you posted
yes i have vqmod installed :)
i noticed you said you couldn't upload a file
any particular format for the homemade file?

thanks :)

www.pattestersuffolk.co.uk


Active Member

Posts

Joined
Sat Sep 17, 2011 2:46 pm


Post by smitch6 » Sat Jan 21, 2012 3:41 am

sorted sort of
i saved it as an xml file and uploaded it via VQmod after i changed all the default to my current theme
and it has removed most of the compares apart from the main page with the feature images
the theme i use shows a compare on there and it's still there :( any ideas pls :)

www.pattestersuffolk.co.uk


Active Member

Posts

Joined
Sat Sep 17, 2011 2:46 pm


Post by smitch6 » Sat Jan 21, 2012 3:47 am

i tried adding this code to the file
<file name="catalog/view/theme/theme46/template/product/feature.tpl">
<operation>
<search position="replace">
<![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]>
</search>
<add>
<![CDATA[<!-- -->]]>
</add>
</operation>
</file>
but with no joy
this is the problem i'm facing see attached image
Screen Shot 2012-01-20 at 19.46.57.png

Screen Shot 2012-01-20 at 19.46.57.png (38.92 KiB) Viewed 18886 times


www.pattestersuffolk.co.uk


Active Member

Posts

Joined
Sat Sep 17, 2011 2:46 pm


Post by olimax » Sat Jan 21, 2012 6:36 am

Sorry
My mistate.
I have added it to the original post now

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by smitch6 » Sat Jan 21, 2012 5:30 pm

Sorry it doesn't work with my theme on the latest .3 version :(

www.pattestersuffolk.co.uk


Active Member

Posts

Joined
Sat Sep 17, 2011 2:46 pm


Post by olimax » Sat Jan 21, 2012 5:40 pm

you have to change the files tag to point to your theme

eg

Code: Select all

<file name="catalog/view/theme/default/template/product/category.tpl">
change to:

Code: Select all

<file name="catalog/view/theme/YOURTHEME/template/product/category.tpl">

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London
Who is online

Users browsing this forum: No registered users and 2 guests