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 1 of 3
Remove product comparison option
 
RaceCondition
Jr. Member
 
Total Posts:  3
Joined:  2008-02-13
 

How do I remove the product compare feature? I have a book store and it doesn’t make a lot of sense to compare books.

Also, will there be any default book related stuff in Magento? Right now I even have to add attributes like “author”, “publisher”, “year”, “isbn” etc. Bookstores are popular so why not offer built-in functionality for books.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iblastoff
Sr. Member
 
Total Posts:  252
Joined:  2007-08-31
 

why? because not everyone is going to be running a bookstore? you can make your own attribute sets specifically for books. i see no reason why something so specific should be built-in.

to remove the compare feature at least from the front end, delete/comment out the block that references the compare/sidebar from catalog.xml. you probably have to disable some other product specific stuff as well but i don’t know it offhand atm.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gabrielk
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2007-11-30
 

Just remove the comparison links in the template files.

As far as adding fields by default, there’s just no reason to, Magento’s built to be an open platform so that you can add any kind of desired attributes you want (e.g., size, isbn, author, whatever).  There’s a lot of EVERY kind of store on the net, I’m glad attributes required by each specific kind aren’t in there by default.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RaceCondition
Jr. Member
 
Total Posts:  3
Joined:  2008-02-13
 

There could be some example attribute sets, but that’s a matter of opinion.

 
Magento Community Magento Community
Magento Community
Magento Community
 
paul@moodandmind.com
Member
 
Avatar
Total Posts:  65
Joined:  2008-01-13
 

I’ve found that the easiest solution is to turn off “Comparable on Front End” on all of your attributes under Manage Attributes.

If you do this the compare feature should not be active.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mr_dimsum
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-28
 
paul@moodandmind.com - 12 April 2008 11:34 AM

I’ve found that the easiest solution is to turn off “Comparable on Front End” on all of your attributes under Manage Attributes.

If you do this the compare feature should not be active.

How does this remove the Compare feature on the front-end? As far as I know, by simply turning off “Comparable on Front End” only makes it to the specified attribute cannot be compared. This does not mean that the function is disabled nor is the block removed I think.

If anybody has any ideas on how about to remove this, kindly appreciated! =)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Loxam
Member
 
Total Posts:  60
Joined:  2008-03-17
 

Having the same issue, deactivated all the attributes but they still showing as comparable on front end.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

wow , It’s kind of hard stuff to do, bro…
I still can’t find to turn the ‘compare product’ off,

here is another way to close / disable it :
go to app/design/frontend/default/default/template/catalog/product/list.phtml

change <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/> into <?php if(false && $_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/>

if there is something wrong please tell me....

 
Magento Community Magento Community
Magento Community
Magento Community
 
redrokit
Jr. Member
 
Total Posts:  9
Joined:  2008-04-16
 
paul@moodandmind.com - 12 April 2008 11:34 AM

I’ve found that the easiest solution is to turn off “Comparable on Front End” on all of your attributes under Manage Attributes.

If you do this the compare feature should not be active.

Where is the Manage Attributes at?
thanks,
grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
SER
Jr. Member
 
Total Posts:  3
Joined:  2008-04-10
 
alkarim - 20 April 2008 06:37 PM

wow , It’s kind of hard stuff to do, bro…
I still can’t find to turn the ‘compare product’ off,

here is another way to close / disable it :
go to app/design/frontend/default/default/template/catalog/product/list.phtml

change <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/> into <?php if(false && $_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/>

if there is something wrong please tell me....

Nothing happens its still visible
Sunil

 
Magento Community Magento Community
Magento Community
Magento Community
 
dax
Member
 
Total Posts:  32
Joined:  2008-04-25
 

I’m glad I’m not the only one that was frustrated with this - and thanks to a combination of some tips in the posts above and some trial-and-error hacking, I think I have finally cracked it!  That said, I’m a complete newbie to both Magento and php programming, so if anyone knows of a more elegant solution, I’d be very glad to hear about it…

To remove all of the references to product compares, there are a lot of files to edit in your app/.../theme directory tree. In fact they are all in the {theme}/template/category/product directory path (I think). There are two types of modification to make :

1. Files that list products, where the “Add to Compare” must be disabled
- {theme/.../product}/list.phtml
- {theme/.../product}/new.phtml
- {theme/.../product}/view/bundle.phtml
- {theme/.../product}/view/type/configurable.phtml
- {theme/.../product}/view/type/grouped.phtml
- {theme/.../product}/view/type/simple.phtml
In all of these files, the objective is to comment out the code creating the “Add to Compare” link.
To do this, open the files in your favourite code editor, search for “compare”, and place an HTML comment around the php code that creates the unwanted link. To be doubly sure, you can add a false&& into any conditional clauses you find. Of course, either of these two methods will work on their own - and you could also remove the code altogether, but that would make it harder to reinstate at a later point.

For example, in list.phtml, I change the code :

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

...to…

<!-- START OF COMMENT *** false added to condition belowto force out compare (and HTML comment spans it also)
    
<?php if(false&&$_compareUrl=$this->getAddToCompareUrl($_product)): ?>
        
<span class="pipe">|</span>
            <
a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare'?></a>
    
<?php endif; ?>
*** END OF COMMENT -->

*** NOTE - not all occurrences of the word ‘compare’ need to be removed ***

2. Files that present the list of compared items. Two files :
- {theme/.../product}/compare/list.phtml - no change really required, as this page can no longer be reached, but when I have a more elegant solution, this will need adjusting also.

- {theme/.../product}/compare/sidebar.phtml - which produces the compare box in the sidebar.
Basically I just create a condition around the code that blocks all output:

At the start of the file (between the header comments and the first <div> statement, insert the line :

<?php if(false)?>
... and close this at the end of the code (very last line):
<?php endif; ?>

... et voila!  Let me know how you get on.

I’m looking into a better way, to control this all via the admin screens (or at least the database) in a similar way to the Wishlist. Will update you all on this in due course…

David

 
Magento Community Magento Community
Magento Community
Magento Community
 
dax
Member
 
Total Posts:  32
Joined:  2008-04-25
 

I’m looking into a better way, to control this all via the admin screens (or at least the database) in a similar way to the Wishlist. Will update you all on this in due course…

... and quicker than I thought!

I really didn’t like the solution as it was, and have developed a way to control this via the database instead. Acctually quite simple (for the baseline), but then there are many files that need to have it integrated.

Now in the process of testing and documenting this for the Magento community, and will include a theme that includes all the required files, so that you can all implement this on your servers.

Will post back here again when done - hopefully later today.

David

 
Magento Community Magento Community
Magento Community
Magento Community
 
dax
Member
 
Total Posts:  32
Joined:  2008-04-25
 

IT WORKS !

I have now got the product compare and related artefacts switching nicely on a default Magento website

If anyone’s interested, I have posted the code and explanatory document to a new thread :

http://www.magentocommerce.com/boards/viewthread/7344/

Hope that helps someone!

David

 
Magento Community Magento Community
Magento Community
Magento Community
 
caos989
Sr. Member
 
Total Posts:  96
Joined:  2008-07-25
Linz, Austria
 

where I can remove the “OR” ???

In my simple.php there is only this code
\app\design\frontend\default\default\template\catalog\product\view\type\simple.php

<?php $_product $this->getProduct() ?>

<?php 
if($_product->isSaleable()): ?>
    
<class="availability"><?php echo $this->__('Availability: In stock.'?></p>
<?php else: ?>
    
<class="availability"><?php echo $this->__('Availability: Out of stock.'?></p>
<?php endif; ?>

<?php 
echo $this->getPriceHtml($_product?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
XjSv
Member
 
Avatar
Total Posts:  38
Joined:  2008-08-19
Ridgewood, NY
 

How come this sounds like a much easyer way???
http://www.magentocommerce.com/boards/viewthread/8365/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Robert H
Member
 
Avatar
Total Posts:  38
Joined:  2008-11-16
 
caos989 - 16 August 2008 02:42 AM

where I can remove the “OR” ???

In my simple.php there is only this code
\app\design\frontend\default\default\template\catalog\product\view\type\simple.php

<?php $_product $this->getProduct() ?>

<?php 
if($_product->isSaleable()): ?>
    
<class="availability"><?php echo $this->__('Availability: In stock.'?></p>
<?php else: ?>
    
<class="availability"><?php echo $this->__('Availability: Out of stock.'?></p>
<?php endif; ?>

<?php 
echo $this->getPriceHtml($_product?>

I was unable to find anything to remove in any of the/catalog/product/view/type files as recommended. Now I have the sidebar removed THANK YOU but the link is still on my product pages.

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