0

I'm looking for a solution to disable all add cart buttons on every page in the frontend without using phtml file or CSS.
I've found some solutions but for disabling price, but not add to cart button, I hope to find some solution like this:
How to hide price in magento2

Any idea, please help :) Thanks

2
  • did you follow this link? or this might be helpful to you
    – Hitesh
    Commented Oct 3, 2018 at 14:50
  • thanks, but this 2 link still use phtml file as well :(
    – fudu
    Commented Oct 3, 2018 at 15:13

1 Answer 1

1

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.

1
  • 1
    thanks for reply, it's been so long, i can't verify this answer at the moment .. sorry :(
    – fudu
    Commented Dec 16, 2021 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.