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 2
This is how to remove “Add to Cart” buttons from catalog pages
 
john_wilson
Member
 
Total Posts:  35
Joined:  2007-09-20
 

I figured out how to remove the “Add to Cart” buttons from the catalog pages.

This is how you do it:

All you have to do is find the right file to edit, then you just need to delete some code in that file.

The file you need to edit is list.phtml

You can find it by going to: app > design > frontend > default > default > template > catalog > product > list.phtml

Because the catalog pages can by viewed in either grid mode or list mode, there are two references to the “Add to Cart” button in the code within the list.phtml file.  Make sure you delete the code in both sections.  If you read the code, you will see where it says list mode and grid mode.

Look for this code, then delete it:

<?if($_product->isSaleable()):?>
            
<button class="form-button" onclick="setLocation('<?=$this->getAddToCartUrl($_product)?>')"><span><?=__('Add to Cart')?></span></button>
            
<?endif;?>

Once you’ve done that, you shouldn’t see the “Add to Cart” buttons on the catalog pages anymore. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
sticky
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2007-09-05
UK
 

I’ll let you add this info to the wiki then… wink

May help somebody in the future!

 
Magento Community Magento Community
Magento Community
Magento Community
 
john_wilson
Member
 
Total Posts:  35
Joined:  2007-09-20
 

I added it to the wiki

 
Magento Community Magento Community
Magento Community
Magento Community
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

Hello,

Faster and more clean option would be to go to
app\code\core\Mage\Catalog\Model\Product.php,
function isSalable or function isSaleable, comment the return line,
and replace with return false; , and would do the trick.

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
john_wilson
Member
 
Total Posts:  35
Joined:  2007-09-20
 

Adding and changing code is cleaner than deleting code?  You sure about that?

Less code = clean and fast in my experience

Also, I believe the isSalable function is needed on the individual product pages as well as the catalog pages, so if you change it to return false, it might remove the “Add to Cart” buttons from the whole website, and nobody will be able to buy anything because it will be impossible to add any products to the cart.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

Hello,

If you just want to remove such functionality for some products -> better to remove from admin.
If you need to remove from all site -> better (in my opinion) is to change the function, not delete code in templates that you might want back in a while.
If you just want to remove “add to cart” from some pages -> you might just amend the function, make new one, etc, not delete template code.

However, one is free to do as he pleases smile

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
john_wilson
Member
 
Total Posts:  35
Joined:  2007-09-20
 

As far as I can tell, there is no way to remove “Add to Cart” buttons from admin.  Even if there was, this thread is about removing the “Add to Cart” buttons from the catalog pages, not just some products.

If you want to remove the buttons from the whole site, then your solution might work, but that’s not what this thread is about.  This thread is about removing the “Add to Cart” buttons from the catalog pages.  Very few people would want to remove the “Add to Cart” buttons from the whole site anyway, because that means you would not be able to buy anything.

In my experience, changing template code is almost always better than changing the underlying code that runs a program like Magento.  Removing buttons is a design choice, so just change the design files.  There are dangerous consequences for changing the code that runs Magento.

Also, the code that runs Magento will change with future updates, so if you change the code, then install an update, you will very likely find that you need to change the code again, and again, every time you install a new Magento update.  Which is why design templates were invented.  Use the design templates, that is why they exist.

 
Magento Community Magento Community
Magento Community
Magento Community
 
leetaylordoes
Sr. Member
 
Total Posts:  227
Joined:  2008-02-05
San Diego, CA
 

Hey guys,

Any quick ideas how to add an “add to cart” button under all product full description pages?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dragonfire
Jr. Member
 
Total Posts:  1
Joined:  2009-07-23
 

Hi!

About yet the title of this topic “remove “Add to Cart” buttons from catalog pages”. I need to remove the buttons for all produts, because my client wants only to enable the store in a month, now he wants only online catalog.
When I return false “function isSalable\\\”, the button disappear but the products appears not avaliable
Help me please!
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
reza nazarian
Jr. Member
 
Total Posts:  4
Joined:  2010-07-05
 

i found the simple way to delete add to cart button from the product page

just delete/rename this file :
/app/design/rontend/base/default/template/catalog/product/view/addtocart.phtml

wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
joshuajarman
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2009-04-08
 

Quick Tip:

If you just need to hide the Add to Cart button on the catalog pages, no need to edit core files, delete or rename files, or even edit any template code.  All you need is one line of css.

If you want to remove the Add to Cart button from the products grid use this:
.products-grid button.btn-cart { display: none; }

If you want to remove the Add to Cart button from the products list use this:
.products-list button.btn-cart { display: none; }

If you want to remove them from both:
.products-grid button.btn-cart, .products-list button.btn-cart { display: none; }

Same for removing reviews, tiered pricing, etc. etc. from these pages especially if you plan on keeping those functions on the product page.  (if you really need to remove the functionality altogether instead of hiding it then you should be editing the respective layout xml files or overriding them in a local xml file, NOT editing core files or deleting base/default files.)

Hope that helps.

Cheers,
Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
doughboy
Member
 
Total Posts:  55
Joined:  2010-03-29
 

Josh,
I think your solution will be clean and easy.  Can you tell me exactly where we are suppose to put the CSS code?

Thanks,

Tim

 
Magento Community Magento Community
Magento Community
Magento Community
 
joshuajarman
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2009-04-08
 

Place those css lines at the end of your themes/templates styles.css file and you should be good to go.

 
Magento Community Magento Community
Magento Community
Magento Community
 
seanbreeden
Member
 
Avatar
Total Posts:  74
Joined:  2010-02-12
Cincinnati, OH
 

*duplicate* -delete- smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
doughboy
Member
 
Total Posts:  55
Joined:  2010-03-29
 

.products-grid button.btn-cart, .products-list button.btn-cart { display: none; }

I placed the above line in my l/skin/frontend/default/MyTheme/css/sytles.css and as you can see from the attached screenshot, the add to cart is still there.  Any ideas?

Since they have to choose Size and Color AND we offer customizing, I only want them to be able to click on ADD TO CART on the actual product page, not in search results, category view, etc.

Thanks a bunch for your help on this!!

Image Attachments
Remove-Add-To-Cart.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
joshuajarman
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2009-04-08
 

can you post the url to the site, i’ll take a look.  thanks.

you can also try moving the line to the bottom of your stylesheet, or adding !important to the declaration.
{ display: none !important; }

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