Disable "Add To Compare" button in Magento

could you help me to disable "Add To Compare" button in magento ?

i want to remove add to compare, when hover the product ? and this is link of my site : http://dev.kesato.com/lepetitcartel

Answers


The links above appear to be for v1.7. However, this worked for me in v1.9:

Open: app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml and remove or comment:

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

Do the same to grid view.

Then, open: app/design/frontend/yourpackage/yourtheme/template/catalog/product/view/addto.phtml and remove or comment:

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

Lastly, open: app/design/frontend/yourpackage/yourtheme/layout/catalog.xml and remove or comment:

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

Save and clear cache.


An easy way to disable the wishlist, without the need to touch any code is in the backend: system_config/edit/section/advanced

Configuration / Advanced / Advanced

just find Mage_Wishlist near the bottom of the list and choose disable and Save Config


There are many ways to axe the compare products functionality in different places of your site.

http://www.aschroder.com/2009/07/removing-the-compare-function-in-magento-the-easy-way/

http://inchoo.net/magento/removing-product-comparison-in-magento/


Copy ~/app/code/core/Mage/Catalog/Helper/Product/Compare.php to ~/app/code/local/Mage/Catalog/Helper/Product/Compare.php

and change the following code:

Goto About 165 no Line Just Change as Follow , It May be compeletely remove Compare Option

public function getAddUrl($product)
    {
        if ($this->_logCondition->isVisitorLogEnabled() || $this->_customerSession->isLoggedIn()) {
           return $this->_getUrl('catalog/product_compare/add', $this->_getUrlParams($product));

        }
        return '';
    }

Changed To

 public function getAddUrl($product)
    {
        if ($this->_logCondition->isVisitorLogEnabled() || $this->_customerSession->isLoggedIn()) {
            //return $this->_getUrl('catalog/product_compare/add', $this->_getUrlParams($product));
            return false;
        }
        return '';
    }

All the answers given tell you to remove add to compare button from the product page but this link also comes in the display of all products by category from which we go on particular product page .To remove from that page

app/design/frontend/<theme>/default/template/catalog/product/list.phtml

go to the text

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

and comment it out or rather delete it.

Hope it helps you.


Great question and very simple answer

if none of the above solution work try this just go to the file view.phtml at location app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml

find the block

and block the complete division as:

            <!--    <div class="add-to-box add-to-box1">
                    <div class="actions-inner">
                        <?php echo $this->getChildHtml('addto') ?>
                        <?php if ($this->canEmailToFriend()): ?>
                        <ul class="add-to-links">
                            <li>
                                <a class="email-friend fa fa-envelope" title="<?php echo $this->__('Email to a Friend') ?>" href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><span><?php echo $this->__('Email to a Friend') ?></span></a>
                            </li>
                        </ul>
                        <?php endif; ?>
                    </div>  
                </div>

                -->

it will surely work you can contact me at sagar.career1122@gmail.com

@sagar


I did this and it worked...Using Rindex data Log into your magento admin, then to go your system, and then INDEX MANAGEMENT, after loading, selec all index and then by your right at the top submit to rindex..the refresh your homepage..OOHLA there you go!!


Need Your Help

Trouble creating a Java policy server for a simple Flash app

java flash cross-domain policy

I'm trying to create a simple Flash chat application for educational purposes, but I'm stuck trying to send a policy file from my Java server to the Flash app (after several hours of googling with ...