[vQmod] Remove Add to Compare
42 posts
• Page 1 of 3 • 1, 2, 3
[vQmod] Remove Add to Compare
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.
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.
- 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 Fri Jan 20, 2012 10:35 pm, edited 1 time in total.
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
Nice job.
I have a problem though, when applying this instead of removing the "add to compare" I get a "null" text...
Any idea?
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
- Wallimann
- Posts: 85
- Joined: Thu Oct 28, 2010 5:38 pm
- Location: Colorado
Re: [vQmod] Remove Add to Compare
same here, it does removed the "add to compare" but its replaced by "null"
- stewiek
- Posts: 24
- Joined: Mon Nov 09, 2009 8:04 am
Re: [vQmod] Remove Add to Compare
Curious.
Try this
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 11:11 am, edited 1 time in total.
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
Please note this is for vQmod Version 2 if that makes any difference
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
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)
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)
- merrydukaan
- Posts: 47
- Joined: Sun Jan 01, 2012 7:26 am
Re: [vQmod] Remove Add to Compare
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?
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
Hi Olimax,
Yes, I used the updated version. The null appears on product list page, an example:
http://www.indivineinterest.com/shop/T-shirts/Hanuman%20Tee
Yes, I used the updated version. The null appears on product list page, an example:
http://www.indivineinterest.com/shop/T-shirts/Hanuman%20Tee
>> search before you post and [solved] when solved
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)
- merrydukaan
- Posts: 47
- Joined: Sun Jan 01, 2012 7:26 am
Re: [vQmod] Remove Add to Compare
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
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
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
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.
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)
>>Opencart v1.5.1.3, php 5.1.6, Apache/2.2.3 (CentOS)
- merrydukaan
- Posts: 47
- Joined: Sun Jan 01, 2012 7:26 am
Re: [vQmod] Remove Add to Compare
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.
-

someguy9 - Posts: 9
- Joined: Wed Jan 11, 2012 3:14 pm
- Location: College Park, MD
Re: [vQmod] Remove Add to Compare
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.
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.
- takahashi1973
- Posts: 134
- Joined: Thu Oct 13, 2011 3:41 pm
Re: [vQmod] Remove Add to Compare
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
have i got to make my own tpl file from the code above? or just find it somewhere and change it?
thanks
- smitch6
- Posts: 155
- Joined: Sat Sep 17, 2011 6:46 am
Re: [vQmod] Remove Add to Compare
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
then just drop the file into the xml directory XML in vqmod
and Fanny's your aunt
...hopefully
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
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
sorryso 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

- smitch6
- Posts: 155
- Joined: Sat Sep 17, 2011 6:46 am
Re: [vQmod] Remove Add to Compare
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 
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 
- smitch6
- Posts: 155
- Joined: Sat Sep 17, 2011 6:46 am
Re: [vQmod] Remove Add to Compare
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
<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
- smitch6
- Posts: 155
- Joined: Sat Sep 17, 2011 6:46 am
Re: [vQmod] Remove Add to Compare
Sorry
My mistate.
I have added it to the original post now
My mistate.
I have added it to the original post now
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
Re: [vQmod] Remove Add to Compare
Sorry it doesn't work with my theme on the latest .3 version 

- smitch6
- Posts: 155
- Joined: Sat Sep 17, 2011 6:46 am
Re: [vQmod] Remove Add to Compare
you have to change the files tag to point to your theme
eg
change to:
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">
-

olimax - Posts: 77
- Joined: Thu Dec 22, 2011 9:08 am
- Location: Barcelona & London
42 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 20 guests













