cancel
Showing results for 
Search instead for 
Did you mean: 

Replace "add to cart" button in category/front-page with "Product Details" button

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Replace "add to cart" button in category/front-page with "Product Details" button

In the category view, each product has an "add to cart" button as a default.

Is it possible to remove this button, and replace it with a button that will lead to the product detail page?

 

Thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Replace "add to cart" button in category/front-page with "Product Details" b

You can try the code for the buttons and links in list.phtml. to change "Add to cart" button to "Product Details" (app/design/frontend/Yourtheme/Magento_Catalog/templates/product/list.phtml)

 

The code which directs to the product detail page when clicking is the following:

<a class="add-to-cart"
   href="<?php echo $_product->getProductUrl() ?>">
   <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
</a>

 

View solution in original post

1 REPLY 1

Re: Replace "add to cart" button in category/front-page with "Product Details" b

You can try the code for the buttons and links in list.phtml. to change "Add to cart" button to "Product Details" (app/design/frontend/Yourtheme/Magento_Catalog/templates/product/list.phtml)

 

The code which directs to the product detail page when clicking is the following:

<a class="add-to-cart"
   href="<?php echo $_product->getProductUrl() ?>">
   <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
</a>