Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 1 of 2
Switchable solution to enable/disable Product Compare
 
dax
Jr. Member
 
Total Posts:  11
Joined:  2008-04-25
 

Very much a newbie to Magento (and to php programming also), one of the first things I wanted was to switch off the Product Compare feature, and all the related artefacts that appear in the site, which lead me to this thread (#3405).  Most of the proposed solutions were pretty much one-way mods, so I used the opportunity to develop a switchable solution instead.

It turns out that there are several files affected - so this took a little longer than expected, but I believe the result is now pretty much OK.

You can find the details in the attached ZIP file, including sample files (based on the default template) and an explanatory Word document

*** WARNING - the solution includes a manual data entry to database and modifies one core code file ***
Before you panic – this is still utilising standard functionality of Magento, so should not break anything (and I have tested it a bit also), but it does mean that the solution may become redundant in a future release of the product. Until then, the following solution will work just fine! (Naturally, I present the code as-is, with no claims that it is anyhting other than a

I welcome your comments - and if anyone in the Core Team finds it useful enough to add as a more “permanent” package, then so much the better!

Regards,

David (Dax)
Newbie, running on a Windows XP VM.

File Attachments
themeCompare.zip  (File Size: 38KB - Downloads: 146)
Readme - Product Compare switching.doc  (File Size: 50KB - Downloads: 268)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  68
Joined:  2007-09-18
Lithuania/Vilnius
 

I have made module which hides prices when not logged in and hides Add to compare links although the laouts should be modified by hand to not show compare options… the code is hosted here: http://code.google.com/p/magentohideprice/ u don’t need to modify any of core or template files to hide Add to compare link so I think it is good solution for those who don’t keen in coding, there is only one thing this module hides prices if not logged in… in future plans there is a backend where u may turn on off features. It is still in early beta but I believe that someday I’ll release it as stable :D

 Signature 

Magento drives me crazy....

 
Magento Community Magento Community
Magento Community
Magento Community
 
plainspace
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2008-01-23
 
mk30 - 21 May 2008 04:39 PM

I have made module which hides prices when not logged in and hides Add to compare links although the laouts should be modified by hand to not show compare options… the code is hosted here: http://code.google.com/p/magentohideprice/ u don’t need to modify any of core or template files to hide Add to compare link so I think it is good solution for those who don’t keen in coding, there is only one thing this module hides prices if not logged in… in future plans there is a backend where u may turn on off features. It is still in early beta but I believe that someday I’ll release it as stable :D

Is it possible to use this just to hide the add to compare link? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  68
Joined:  2007-09-18
Lithuania/Vilnius
 

Yes it is delete other two controllers in config xml and leave just compare. It should work then.

 Signature 

Magento drives me crazy....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Synapse
Jr. Member
 
Total Posts:  4
Joined:  2008-05-12
 
mk30 - 21 May 2008 04:39 PM

I have made module which hides prices when not logged in and hides Add to compare links although the laouts should be modified by hand to not show compare options… the code is hosted here: http://code.google.com/p/magentohideprice/ u don’t need to modify any of core or template files to hide Add to compare link so I think it is good solution for those who don’t keen in coding, there is only one thing this module hides prices if not logged in… in future plans there is a backend where u may turn on off features. It is still in early beta but I believe that someday I’ll release it as stable :D

We’re using the Modern theme with Magneto v.1.0.19870 ... the module has hidden the price and the compare link in the product however it has left the left hand side ‘compare products’ box ? ... any idea how to get rid of that left hand side box ?

Update: The price on the product details is hidden when not logged in however the ‘filter by price’ remains active when not logged in ... which I assume shouldn’t when by using this module you don’t want a consumer seeing any pricing information until they log in.

 
Magento Community Magento Community
Magento Community
Magento Community
 
setanta
Member
 
Total Posts:  31
Joined:  2007-11-01
 

Thanks for the modlue for hiding prices mk30.

Is it possible to also hide the price when a customer who is not logged in adds an item to their shopping cart?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Very Clever Stuff
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2008-05-06
Sheffield, UK
 

Hi David,

Thanks for this, it worked great! Just a quick note…

dax - 30 April 2008 03:20 PM

*** WARNING - the solution includes a manual data entry to database and modifies one core code file ***

This isn’t strictly true. If you copy the Compare.php file to the app/code/local/ folder then you can leave the originally app/code/core/ file in tact (and the changes will still apply).

Looking forward to an admin frontend… I may have to get on that if no-one else does!

 Signature 

Dave Speake
Very Clever Stuff

 
Magento Community Magento Community
Magento Community
Magento Community
 
drewby07
Jr. Member
 
Total Posts:  4
Joined:  2008-08-08
 

mk30 - I installed your contribution and it doesn’t seem to do anything.  I’m running ver 1.1.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
Very Clever Stuff
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2008-05-06
Sheffield, UK
 

It was written for v1.0

 Signature 

Dave Speake
Very Clever Stuff

 
Magento Community Magento Community
Magento Community
Magento Community
 
wokka
Jr. Member
 
Total Posts:  4
Joined:  2008-06-06
 

Has anyone tried this solution on version 1.1.3? The compare product function is not needed for what we sell.

Thanks for you’re help

John

 
Magento Community Magento Community
Magento Community
Magento Community
 
DDMAN
Sr. Member
 
Total Posts:  104
Joined:  2008-01-08
 

I’m running 1.1.3 as well and would be interested in getting rid of compare products very much like ho you can turn wishlist on and off.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael R
Jr. Member
 
Total Posts:  6
Joined:  2008-08-04
 

I also am looking for a way to remove it in 1.1.3, if only to compliment a more minimalistic design. I’ve tried commenting out the relevant lines in the layout xml, but it didn’t seem to have any effect. It may also be called explicitly elsewhere but I haven’t had a chance to sniff out all the offending areas.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  68
Joined:  2007-09-18
Lithuania/Vilnius
 

No solution for new versions yet.... they have changed the way prices shows up in catalog at the moment I can not figure out how do they do this… any ideas… magento team…

 Signature 

Magento drives me crazy....

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  357
Joined:  2008-08-21
 

I modified the phtml file where the compare box is printed out. If there is anything to compare (collection count > 0) then it prints the box, otherwise it doesn’t.
But this doesn’t take out all the links to Add to Compare if you don’t want the functionality at all.  And they are in a lot of template files.
I was changing them to have “nofollow”, so I was thinking “Why isn’t there one function for this, so all could be changed in one place?”

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  68
Joined:  2007-09-18
Lithuania/Vilnius
 

Hide price update for magento 1.1.4 not fully tested :D http://code.google.com/p/magentohideprice here u go smile they changed the way they output prices so I needed to overlook some code… and I haven’t found time before smile

 Signature 

Magento drives me crazy....

 
Magento Community Magento Community
Magento Community
Magento Community
 
TheIdeaMan
Jr. Member
 
Total Posts:  1
Joined:  2008-07-30
 

You can remove the compare sidebar link in…
layout/catalog.xml
and the “add to compare” link in…
template/catalog/product/view/addto.thtml

Doesn’t shut it off, exactly, just hides it.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 2
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53192 users|744 users currently online|107224 forum posts