Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
REMOVE “Add To Compare” Please Help! 
 
matt1237
Member
 
Avatar
Total Posts:  70
Joined:  2008-05-15
Washington State
 
Ravikumar N B - 12 February 2009 11:02 PM

I didnt find any configuration to disable the compare products module.
But we can build one new theme or modify few default templates then we can remove “COMPARE PRODUCTS” module.

* Remove right side Compare products box
Remove single line from magento/app/design/frontend/default/default/layout/catalog.xml Line: 59

<block type="core/template" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
* Remove Add to Compare link from below files
/magento/app/design/frontend/default/default/template/catalog/product/view/addto.phtml Line:35
/magento/app/design/frontend/default/default/template/catalog/product/new.phtml Line:54
/magento/app/design/frontend/default/default/template/catalog/product/list.phtml Line:78, 116
/magento/app/design/frontend/default/default/template/checkout/cart/crosssell.phtml Line:49
/magento/app/design/frontend/default/default/template/reports/home_product_viewed.phtml Line:61
/magento/app/design/frontend/default/default/template/reports/home_product_compared.phtml Line:55
<a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare'?></a>

Any one have some other soultions???

Thanks for the tip… this did the trick for me although the line numbers are a little different in the blank theme.  No worries with a little CTRL+F searching wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
MaxOnTheHill
Member
 
Avatar
Total Posts:  56
Joined:  2009-04-10
Olinda, Victoria, Australi
 

Removing the boxes from the side is easy - just have to look in the right spot.

From memory look in customer.xml (yes, of all places) and remove/comment from there.

The other one I can remember editing is catalog.xml.

Remember to change the files in the template you are actually using and refresh cache and should work fine.

Hope that helps, Max

 
Magento Community Magento Community
Magento Community
Magento Community
 
spinicrus
Jr. Member
 
Total Posts:  5
Joined:  2010-01-31
 

you cand find all occurences of “Add to compare”, and then edit the files, comment the lines. if you work on a unix box, you can try something like this:

(cd into your magento directory first)

find . | xargs grep ‘Add to compare’ -sl

and if you want to limit the search to your theme’s folder/name you cand call grep at the end:

find . | xargs grep ‘Add to compare’ -sl | grep your_theme_name

cheers wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bimmerhead
Jr. Member
 
Total Posts:  30
Joined:  2009-11-28
Atlanta, GA
 

Kara’s solution works perfectly in 1.4.1

Rather than modifying the default copy of addto.phtml, copy it from \magento\app\design\frontend\base\default\template\catalog\product\view to the appropriate folder in your own theme.

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Also, instead of deleting lines in layout, just comment out the lines with the standard <!-- --> html comment. That way, if you change your mind later, you don’t have to go download the original Magento install, uncompress it somewhere and diff your files to try to get the line back.

 
Magento Community Magento Community
Magento Community
Magento Community
 
new zealand warrior
Member
 
Avatar
Total Posts:  46
Joined:  2010-06-02
 

What i did to remove the compare sidebar was within /app/design/frontend/default/YOURTHEME/layout/customer.xml added <remove name="catalog_compare_sidebar"></remove> inside “customer logged in” and “customer logged out” between the reference block the sidebar appears in. This is a great dynamic logged in - logged out section to play with within magento!

Heres is my layout with compare sidebar removed >

<!--
Load this update on every page when customer is logged in
-->

<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title” module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
</reference>

<reference name="left">
<remove name="catalog_compare_sidebar"></remove>
<block type="customer/account_navigation" name="customer_sidebar" before="-" template="customer/sidebar.phtml"/>
</reference>


</customer_logged_in>

<!--
Load this update on every page when customer is logged out
-->

<customer_logged_out>
<!---<reference name="left">
<block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
</reference>-->
<reference name="top.links">
<action method="addLink" translate="label title” module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
</reference>

<reference name="left">
<block type="customer/form_login" name="customer_mini_login" before="-" template="customer/form/mini.login.phtml"/>
<remove name="catalog_compare_sidebar"></remove>
</reference>

</customer_logged_out>

Dont forget to flush cache - refresh page
Magento 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
x0backslash0x
Jr. Member
 
Total Posts:  1
Joined:  2011-06-21
 

In order to fully do away with the \’add to compare\’ link showing up on product pages the following files will need to be modified
* catalog/product/view/addto.phtml Line:35-37
* catalog/product/view.phtml Line:67
* catalog/product/new.phtml Line:49-51
* catalog/product/list.phtml Line:73-75;111-113
* checkout/cart/crosssell.phtml Line:49-51
* reports/home_product_viewed.phtml Line:55-57
* reports/home_product_compared.phtml Line:50-52

addto.phtml
This file is responsible for the \’add-to\’ links on the product desription page
Look for the following block of code and either comment out or delete it

<?php $_compareUrl $this->helper(\'catalog/product_compare\')->getAddUrl($_product); ?>

view.phtml
Look for the following block of code

<?php if( $this->helper(\'wishlist\')->isAllow() || $_compareUrl=$this->helper(\'catalog/product_compare\')->getAddUrl($_product)): ?>
    
<span class=\"or\"><?php echo $this->__(\'OR\'?></span>
<?php endif; ?>

change it into

<?php if( $this->helper(\'wishlist\')->isAllow()): ?>
# mind the closing bracket of the \'if\' statement, which will throw a parsing error if omitted
    
<span class=\"or\"><?php echo $this->__(\'OR\'?></span>
<?php endif; ?>
The \’OR\’ seperator is just a side-effect of the mechanisms that checks wether the \’Compare\’ feature is still enabled.
Editing the code this way still allows the seperator to be drawn for other features that (may) make use of it.

new.phtml
Look for the following block of code and either comment out or delete it

<?php if ($_compareUrl $this->getAddToCompareUrl($_product)): ?>
    
<li><span class=\"separator\">|</span> <a href=\"<?php echo $_compareUrl ?>\" class=\"link-compare\"><?php echo $this->__(\'Add to Compare\'?></a></li>
<?php endif; ?>

list.phtml
This file draws the product listing
Look for the same block of code as in new.phtml and either comment out or delete it

crosssell.phtml
look for the following block of code

<?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
    
<li><span class=\"separator\">|</span> <a href=\"<?php echo $_compareUrl ?>\" class=\"link-compare\"><?php echo $this->__(\'Add to Compare\'?></a></li>
<?php endif; ?>

home_product_viewed.phtml
Look for the same block of code as in new.phtml and either comment out or delete it

home_product_compared.phtml
Look for the same block of code as in new.phtml and either comment out or delete it

To remove the sidebar boxes aswell, edit the following files
* app/design/frontend/base/default/layout/catalog.xml Line:59-63
* app/design/frontend/base/default/layout/customer.xml Line:213
* app/design/frontend/base/default/layout/reports.xml Line:34

catalog.xml
Look for the following block of code and either comment out or delete it

<block type=\"catalog/product_compare_sidebar\" before=\"cart_sidebar\" name=\"catalog.compare.sidebar\" template=\"catalog/product/compare/sidebar.phtml\"/>
<
block type=\"core/template\" name=\"right.permanent.callout\" template=\"callouts/right_col.phtml\">
    <
action method=\"setImgSrc\"><src>images/media/col_right_callout.jpg</src></action>
    <
action method=\"setImgAlt\" translate=\"alt\" module=\"catalog\"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>
</
block>

customer.xml
Look for the following block of code and either comment out or delete it

<block type=\"catalog/product_compare_sidebar\" name=\"catalog.compare.sidebar\" template=\"catalog/product/compare/sidebar.phtml\"/>

report.xmll
Look for the following block of code and either comment out or delete it

<block type=\"reports/product_compared\" before=\"right.permanent.callout\" name=\"right.reports.product.compared\" template=\"reports/product_compared.phtml\" />

thanks to Ravikumar N B for posting the solution, which I adapted for v1.5.1.0 and a little extra

The attached archive contains all the above modifications

File Attachments
product-comparison_cure.tar  (File Size: 90KB - Downloads: 81)
 
Magento Community Magento Community
Magento Community
Magento Community
 
hans2504
Jr. Member
 
Total Posts:  6
Joined:  2011-01-18
 

I think the best way to remove the “add to compare” box is to add the following to your layout.xml file:

<remove name="catalog.compare.sidebar"/>
        <
remove name="catalog.compare.list"/>
 
Magento Community Magento Community
Magento Community
Magento Community
 
dikob
Jr. Member
 
Total Posts:  8
Joined:  2011-12-03
 

Won’t a simple CSS line work?

find “.link-wishlist” in “/skin/frontend/default/blank/css/style.css” and replace that line with:

.link-wishlist { displaynonefont-weight:bold}

By default Magento’s cache is enabled. Try deactivating the layout cache while making changes to the layout smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Zwelly
Jr. Member
 
Total Posts:  6
Joined:  2012-01-05
 

I think this is the solution:
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/how_to_remove_add_to_compare

 
Magento Community Magento Community
Magento Community
Magento Community
 
BelowZero
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2009-02-27
 

I’ve created a little module to remove the add-to-compare functionality
https://github.com/hans2103/HideCompare

 
Magento Community Magento Community
Magento Community
Magento Community
 
mmanna
Jr. Member
 
Total Posts:  1
Joined:  2011-07-14
 
BelowZero - 29 July 2012 03:58 AM

I’ve created a little module to remove the add-to-compare functionality
https://github.com/hans2103/HideCompare

Thanks for doing this, but how do i use it. I have read your readme and installed it and it shows up in my advanced modules as enabled, but where can i change the settings in the admin panel to make the compare go away?

Excited to hear back.

 
Magento Community Magento Community
Magento Community
Magento Community
 
openwave_comp
Jr. Member
 
Total Posts:  3
Joined:  2012-04-06
Openwave Computing LLC, 1220 Broadway, Suite #703
 

I too have tried it..but couldnt resolve the problem..

 
Magento Community Magento Community
Magento Community
Magento Community
 
miquil
Jr. Member
 
Total Posts:  6
Joined:  2009-05-05
 

A simple

.link-compare { displaynone}
worked for me
 
Magento Community Magento Community
Magento Community
Magento Community
 
geekzonebooks
Jr. Member
 
Total Posts:  4
Joined:  2013-04-23
 
miquil - 31 January 2013 02:20 PM

A simple

.link-compare { displaynone}
worked for me

Which .css file did you put this in?
What is the path on a default 1.7.0.2 install for CE

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3