How to Remove "Add to cart" Button On all Frontend Pages And also want to know when "Add to cart" Button is Removed then Buyer Can Checkout or not?
I am using Magento 1.9.2.3 version.
Open cPanel or FTP and navigate to the following files:
app\design\frontend\tm_themes\themeXXXX\template\catalog\product\compare\list.phtml
app\design\frontend\tm_themes\themeXXXX\template\review\customer\list.phtml
app\design\frontend\tm_themes\themeXXXX\template\review\product\view\list.phtml
app\design\frontend\tm_themes\themeXXXX\template\tm\productlistgallery\list.phtml
app\design\frontend\tm_themes\themeXXXX\template\wishlist\item\list.phtml
Due to the fact the catalog pages can by viewed in either grid or list mode, there are two references to the Add to Cart button in the code within the list.phtml file. Make sure to comment out the code in both sections.
Look up this code and comment it: ?
<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>
Buyer can checkout even after removal of this add to cart button. Because whenever you click on the product from product list page it will take you to magento's product detail page.there you can add product to cart.then you can go to checkout that product.
The simplest thing you can do is make the display hidden for "btn-cart" class but this will not stop the add to cart functionality. if the user hits the direct Add to Cart url of any product, this will add the product to the cart and checkout will also work. You can write the CSS for hiding the button at style.css or any other custom CSS.
Please describe in which case you want to hide this button for the more specific solution.
This code remove your add to cart button from all pages
app\code\Vendorename\Modulename\etc
di.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Product">
<plugin name="hidecartbutton" type="Vendorename\Modulename\Plugin\Hidecartbutton" sortOrder="1"/>
</type>
</config>
app\code\Vendorename\Modulename\Plugin
Hidecartbutton.php
<?php
namespace Vendorename\Vendorename\Plugin;
use Magento\Catalog\Model\Product;
class Hidecartbutton
{
public function afterIsSaleable(Product $product, $isSaleable)
{
return false;
}
}
I Hope This Helps You.