Categories: Magento 2 Tutorials

How To Hide/Disable Add To Cart Button in Magento 2

If you are running an online store, you will see that there are some specific cases in which you need to put an item on the product page without allowing customers to directly purchase this item. In this case, you will need to hide the Add to cart button on the product page to avoid selling the product. Although Magento administration can programmatically hide or disable the Add to cart button, there are also many available extensions to manage this task without any difficulty. 

In this article, we will provide you with detailed steps on how to hide/disable Add to cart button in Magento 2.

I. Why we need to hide/disable the Add to Cart button

There are some particular circumstances that store owners should display products without the Add to cart button. Hide or disable the Add to cart button in Magento 2 will be a smart choice if:

  • Your store is still working on a product or service, but you want to display this product for SEO and marketing benefits. At that time, the upcoming product still attracts customers to the product page and your stores can advertise new items easily.
  • These products are temporarily out-of-stock, so your shop has to stop selling them at the moment. By removing the Add to cart button, customers are unable to buy products, but they can acknowledge these items and come back the next time to purchase them.
  • There are some items that are not for sale. Customers can view the product details and features to make comparisons, but your store doesn’t offer these products.

II. How to hide/disable the Add to Cart button

Step 1: Create di.xml file in Vendor\Module\etc and copy the below code

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
 <type name="Magento\Catalog\Model\Product">
 <plugin name="hidebutton" type="Vendor\Module\Plugin\HideButton" sortOrder="10" disabled="false" />
 </type>
</config>

Step 2: Create HideButton.php file in Vendor\Module\Plugin and copy the code below.

<?php
 
namespace Vendor\Module\Plugin;
use Magento\Catalog\Model\Product;
 
class HideButton
{
 public function aroundIsSalable(Product $product,\Closure $result)
 {
 return 0;
 }
}

Step 3: Run php bin\magento cache:clean and refresh the page.

Now, the Add to cart button of all products which are filed under the associated category will be hidden. You have finished hide or disable the Add to cart button.

III. List of extensions to hide/disable Add to cart button in Magento 2

Rather than programmatically hide or disable the Add to cart button in Magento 2, store owners can also implement a Magento 2 extension having this feature. There are many Magento 2 Hide price or Call for price extensions providing additional features in the market that you can install to your store.

Hide Price/Call for Price extension is essential for all B2B and B2C businesses, as it is a smart weapon to hide the Add to cart weapon and replace it with diverse call-to-action messages for not logged-in visitors or guests. More than that, this extension also encourages customers to take further actions such as registering or upgrading the customer group and enjoy more competitive advantages at your store.

Here is a list of extensions having the hide/disable Add to cart feature that you can make use of:

Brands

Products

Main features

Price

Detail links

Landofcoder

Magento 2 Hide Price Extension

Magento 2 Hide Price Extension is a smart solution for both B2B & B2C business!

Supporting a basic, easy-to-config function to hide & manage price display based on the customer groups, Magento 2 Hide Product Price customizes the " Add to Cart" button with diverse call-to-action messages for not logged in visitors or the guests.

  • Display customized messages instead of “Add to Cart" button

  • Hide prices from guest customers

  • Hide prices from certain groups of customers

and more

$128

DC10FAE | -10%
B2PLE15 | -15% ( Buy 2)
B3PLE25 | -25% ( Buy 3)

Amasty

Call for Price for Magento 2

Replace the "Add to cart" with flexible options. Place a link with redirection or an image instead of the button. Select the group of customers and particular categories to display the 'Call for price' button to. Easily engage customers into more activity, asking to sign up and provide more feedback.

  • Replace the 'Add to cart' button

  • Hide prices from particular customer groups

  • Display special price only on particular category pages

and more

$169

Mageplaza

Call For Price by Mageplaza

Magento 2 Call For Price supports e-commerce shop owners to manage the product price visibility. Call For Price is useful to specific purposes that push buyers to contact to store as well as hide product prices effectively.

  • Replace Add to cart button with various options

  • Rule-based action for Call for Price

  • Advanced Call for Price Report

and more

$129

Bsscommerce

Call For Price by Bsscommerce

More and more merchants choose Magento platform to launch their wholesale stores due to its rich features. Still, there are lots to improve. Under B2B Category, this Magento 2 Call for price is among the best-sellers. The feature list is the combination of the basic hide price and advanced ask for price function.

  • Replace Add to cart button with text based on your purposes

  • Customize and link the custom Add to cart to Call for Price form

  • Hide price for particular customer groups and categories

and more

$119

Magecomp

Magento 2 Hide Price

Magento 2 Hide Price extension hides product price and add to cart button for not logged in customer and specific customer groups.

  • Option to hide product price & add to cart button

  • Enable extension for specific customer groups if needed

  • Set your custom button title for add to cart button

and more

$49

Meetanshi

Magento 2 Call for Price

Magento 2 Call for Price extension by Meetanshi allows store owners to hide product prices and "Add to Cart" button to replace with "Call for price" button to encourage users to contact for product prices.

  • Hides product prices and " Add to Cart" button.

  • Responsive contact form to receive quote requests.

  • Easy to manage quote inquiries.

and more

$59

Xtento

Magento 2 Hide Price & Call For Price

Hide product prices, disable add to cart functionality for specific categories/products, or even completely disable customer/ shopping cart features in your Magento 2 store. Make your customers call for pricing information. Configurable on a per customer group and store-view level. Flexible, configurable from the backend and with support for custom themes.

  • Disable "Add to Cart" functionality on category and product pages

  • Replace price/add to cart with customizable buttons/text/custom images

  • Hide product prices for certain customer groups (e.g. guests) and force them to register

  • Implement "Call for Price" and "Not to Order" functionality in Magento 2

and more

$129

IV. Wrapping Up!

In certain circumstances, it’s essential for Magento store owners to hide or disable the Add to cart button. This might be due to some particular reasons, such as reference or non-selling products, out-of-stock products or upcoming products. In these cases, display the product without Add to cart button might be a smart solution that helps store owners to gain SEO and marketing effects, without letting customers add purchase this product.

In order to hide or disable the Add to cart button in Magento 2, store owners can do it programmatically, or take advantage of a Hide price/Call for price extension. These extensions come with a set of features that support your Magento store to run smoothly.

We hope that this article can give you a detailed guideline on how to hide/disable the Add to cart button in Magento 2. We also hope that you can get an overview of all the best Magento 2 Hide Price/ Call for Price Extensions on the market. As the number of Magento 2 PDF Hide Price/ Call for Price is countless, it’s up to your business size and demand to pick the most suitable extension for your store!

Mina Phuong

Recent Posts

Salesforce Mobile App Customization and Personalization For Business: A Complete Guide

Salesforce is a strong tool that enables businesses to control processes, customer relations, as well…

2 weeks ago

Latest Mobile App Design Trends That You Should Consider | 2025 Updated

By 2025, the latest mobile app design trends are expected to generate $270 billion from…

3 weeks ago

15+ Must-have Magento 2 Free Extensions To Supercharge Your Store | 2025 Updated

Magento 2 is an incredibly flexible and powerful eCommerce platform that can be tailored to…

1 month ago

Black Friday 2024: Hot Deals Collection For Magento 2

Black Friday and Cyber Monday – BFCM 2024 are nearly around the corner, and it’s…

1 month ago

What To Consider While Using Magento 2.0 For Your Streaming App?

When it comes to e-Commerce platforms, undoubtedly Magento 2.0 grabs the spotlight. Magento might not…

1 month ago

Landofcoder BFCM 2024: Biggest Sale Of The Year – 30% OFF All Magento 2 Extensions

The holiday shopping season is here, and there’s no better time to supercharge your Magento…

1 month ago