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

Remove ‘add to cart’ from category
 
m&nonline
Jr. Member
 
Total Posts:  11
Joined:  2010-03-01
 

Hi there!

I know there are a few topics around about this subject, but I can’t seem to find a working solution for Magento 1.4.1.1

How do I remove the ‘add to cart’ button from the category view? I tried to comment out the sections in list.phtml (both list and grid):

<?php if($_product->isSaleable()): ?>
                        
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart'?></span></span></button></p>
                    
<?php else: ?>
                        
<class="availability out-of-stock"><span><?php echo $this->__('Out of stock'?></span></p>
                    
<?php endif; ?>

I Google’d for about 4 hours but only old topics show up.

Would really appreciate some input! smile

Cheers,

Nick

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom Robertshaw
Moderator
 
Avatar
Total Posts:  485
Joined:  2009-05-17
Bath, UK
 

Hi Nick,

Commenting that out/removing it should have done the job.  What was the path of the file that you were editing?

 
Magento Community Magento Community
Magento Community
Magento Community
 
xmivite
Guru
 
Total Posts:  355
Joined:  2009-10-16
 

check all your extensions , one might be over-riding your list.phtml.

also , always clear cache and disable when developing....

 
Magento Community Magento Community
Magento Community
Magento Community
 
m&nonline
Jr. Member
 
Total Posts:  11
Joined:  2010-03-01
 

Thanks for the replies!

Seems I overlooked the fact that there is a list.phtml file in my theme after all. I was editing the base and default files, so no wonder I didn’t see any results!

Just one more thing though:

Even though I removed the button, the whitespace is still there (see screenshot). Which looks kinda odd, any clues as to how I remove this? Wouldn’t mind to remove the borders as well, but that isn’t my main concern atm.

Thanks again!
Cheers,

Nick

Image Attachments
whitespace screenshot.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom Robertshaw
Moderator
 
Avatar
Total Posts:  485
Joined:  2009-05-17
Bath, UK
 

I suggest using a web developer tool such as Firebug in order to inspect elements and their styling in order to identify what needs changing.  It’ll either be some redundant blocks that need removing or some stylesheets that require adaptation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
m&nonline
Jr. Member
 
Total Posts:  11
Joined:  2010-03-01
 

For some reason Firebug doesn’t show me the path of the file that needs editing hmmm

I tried using Firefox and Chrome (firebug lite) but the only thing I see is that it is related to ‘div.category-products’. Really puzzled as to where I find/edit all these div classes.

Am I overlooking something again?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom Robertshaw
Moderator
 
Avatar
Total Posts:  485
Joined:  2009-05-17
Bath, UK
 

Firebug won’t show you the file that’s needs changing, but it will help to identify what needs to be changed. The div.category-products is actually in the list.phtml file that you were editing earlier.

 
Magento Community Magento Community
Magento Community
Magento Community
 
m&nonline
Jr. Member
 
Total Posts:  11
Joined:  2010-03-01
 

Well, I got it solved!

The space can be removed by editing styles.css and changing the following line:

.products-grid li.item { float:leftwidth:171pxpadding:0 0 90px}

Set the padding to be less than 90px and see it shrink wink

The borders can be removed/commented out from list.phtml via the following lines:

<?php echo $this->getToolbarHtml() ?>

and

<div class=\\\"toolbar-bottom\\\">
        
<?php echo $this->getToolbarHtml() ?>
    
</div>

Took me a while but the result is pleasing!

Thanks for your help Tom smile
Cheers

Nick

 
Magento Community Magento Community
Magento Community
Magento Community
 
christinavick
Guru
 
Total Posts:  355
Joined:  2013-11-13
 

Hi,

please check this thread for help http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/remove-add-to-cart-buttons-from-catalog-pages

Thanks

iLoveMage

 
Magento Community Magento Community
Magento Community
Magento Community
 
aheadWorks
Guru
 
Avatar
Total Posts:  424
Joined:  2008-10-30
 

You can use a ready-made solution for this - the Call for Price Magento extension. The module allows you to hide product price, “Add to Cart” button and replace to an eye-catching call-to action text or anything else in your Magento store. Due to the message compatibility with HTML, you can add a picture, text, link, live chat on the page.

Visit the product page and learn more about the extension.

Image Attachments
CFP1.pngCFP22.png
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top