How To Hide Add To Cart Button in Magento 2

Magento 2 stores allow the users to add products to cart for checkout. However, there may be scenarios where the store owner may want to restrict this action. Disabling add to cart button in Magento 2 store can restrict the users to add products to the cart.

There are several reasons for doing so. For example,

Hide add to cart button for upcoming productsYou are working on some products or software. But you want to start having the SEO benefit of the keyword and not yet actually offer the product. At that time, you can offer the products but disable the add to cart button. Doing so, you can create the hype and also restrict the users to add them to the cart!

Hide add to cart button for out of stock productsIf you are selling products that are currently out of stock and people are looking for it, you can implement the below solution. And also, you can allow them to subscribe to that product for a notification when the product gets back in stock with further customization. Hence, you won’t lose the conversion too!

Hide add to cart button for specific productsProducts that are only sample products or need to not be sold at the moment, implement the below solution.

Before:

After:

The below method to hide add to cart button in Magento 2 disables it from product page as well as the category page.