Today, we’re going to teach you guys how to disable add to cart button in your Magento 2 store.
This is useful when you want to restrict non-registered users from adding products to their carts and make the registration process compulsory in your Magento 2 store.
You can easily disable add to cart button from Magento 2 admin panel for certain customer groups.
In this tutorial, we will show you exactly how to disable add to cart button in your Magento 2 store.
Step-by-Step Process to Disable Add To Cart Button in Magento 2
Please follow the below steps to learn how to disable add to cart button in your Magento 2 store.
Step - 1
First of all, log in to your admin panel and navigate to Stores > Settings > Configuration.
Step - 2
After that, click on the Catalog menu option in the Catalog tab, find the Category Permissions section and do the following:
- Select YES in the Enable field.
Step - 3
Next, find the Allow Browsing Category field and set it to either For Specific Customer Groups or Restrict Access & Redirect to Landing Page.
If you select For Specified Customer Groups, then you need to select which customer groups can see products.
On the other hand, if you select Restrict Access & Redirect to Landing Page, you need to select a landing page to redirect non-registered users to.
Step - 4
Now, in the Display Product Prices field, you need to decide if you want to hide prices from all users or just from the specified customer groups.
Step - 5
After that, select YES or NO in the Allow Adding to Cart for Specified Customer Groups field to remove add to cart button.
Step - 6
Next, you can also restrict non-registered users from Catalog Search in the Disallow Catalog Search field.
Step - 7
Now, save all changes and refresh the cache.
Step - 8
After that, you now need to apply for the category permissions.
For this, navigate to Catalog > Categories and select a category from the category tree.
Step - 9
Next, open the Category Permissions section and click on the New Permission button.
Here, set permission details as per your requirements and save the changes to remove the add to cart button for non-registered users in your Magento 2 store.
Wrapping Up
And there you go!
This is the simplest way to disable add to cart button for non-registered users in your Magento 2 store.
And if you need our professional assistance, feel free to contact us anytime.