How to disable the Add to Cart button in Magento 2?

Say, you want to hide product price from not logged in users or restrict them to add products to the cart. In this case, you can set up category permissions in Magento 2 admin panel and disable the add to cart button for certain customer groups. 

Important: The following settings are available for only Magento Commerce owners. To get similar functionality in Magento 2 Open Source, we recommend installing the Hide Price plugin. It allows you to replace 'Add to Cart' with a custom button, notify admins about new quote requests, and set up auto-replies.


How to remove the add to cart button in Magento 2?

Step 1. Log in to the admin panel and navigate to Stores > Settings > Configuration to disable add to cart button in Magento 2.

Step 2. In the Catalog tab, click Catalog, open the Category Permissions section, and set Enable to Yes.

category permissions settings

Step 3. In the Allow Browsing Category field, you can set For Specific Customer Groups or Restrict Access and Redirect to Landing Page.

If you choose the first option, specify which customer groups can see products in the category. 

category permissions customer groups

For the second option, you will need to select Landing Page for the redirect.

category permissions landing page

Step 4. The next step to remove the add to cart button in Magento 2 is to decide whether to hide prices from all users or specific customer groups in the Display Product Prices field.

Step 5. To remove the Add to Cart button form your Magento 2 frontend, set the Allow Adding to Cart field to No or Yes, for Specified Customer Groups.

Step 6. In the Disallow Catalog Search field, you can restrict users using Catalog Search.

Step 7. Save the changes and refresh the cache.

Step 8. Next, you need to apply for category permissions. For this, go to Catalog > Categories.

Step 9. Choose the needed category from the category tree.

Step 10. Then, open the Category Permissions section and click New Permission.

category permissions apply

Step 11. Set permission details and save the changes in Magento to remove the add to cart button.

How can we help you?

Didn’t you find the answer to your question? We are always happy to help you out.