5

when you browse through a category

www.url.com/catalog/category/view/

you can see several products.

I want to remove the add to cart button from these. You should only be able to put them into the cart when you are on the detailed page of the product.

Edit: here you can see a picture

I am not able to find the right template. Do you know how I can do this?

Thanks!

Edit: Anyone knows how to remove the hover effect when you hover over a product?

2 Answers 2

6

I have looked into this using a Magento version 2.2.4

For me, the add to cart button dissapears after commenting some html in the template below: app/design/frontend/<your_theme_namespace>/<your_theme_name>/Magento_Catalog/templates/product/list.phtml line 78

you may comment the html starting with <div class="actions-primary" (line 78 until line 104 (line closing this div)

6

Add this code in below layout file :

app/design/frontend/Company_Name/Theme_Name/Magento_Catalog/layout/catalog_category_view.xml

<referenceBlock name="product.info.addtocart" remove="true" />

It may be useful for you.

2
  • How to remove it in product detail page? Jul 29, 2019 at 6:02
  • @jafarpinjar for simple products you need to do <referenceBlock name="product.info.addtocart" remove="true" /> and for configurable you need to do <referenceBlock name="product.info.options.wrapper.bottom" remove="true" />
    – Abbas
    Nov 5, 2019 at 9:10

Your Answer

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

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