Change the ‘add to cart’ button to ‘view product’ in Magento on category page

So you’ve got your webshop with products with different sizes. The ‘add to cart’ button on the category page is sometimes a step too much, because you’ll have to choose a size first.

Changing the button to ‘view product’

Changing the button to ‘view product’ would be a better solution. Open the file list.phtml in: /app/design/frontend/default/{yourskin}/template/catalog/product .

About line 63 and about line 107 replace: <p><button type=”button” title=”<?php echo $this->__(‘Add to Cart’) ?>” onclick=”setLocation(‘<?php echo $this->getAddToCartUrl($_product) ?>’)”><span><span><?php echo $this->__(‘Add to Cart’) ?></span></span></button></p>

With:

<button type=”button” title=”<?php echo $this->__(‘Add to Cart’) ?>” onclick=”setLocation(‘<?php echo $_product->getProductUrl() ?>’)”><span><span>View product</span></span></button>

Leave a Comment

Your email address will not be published. Required fields are marked *

en_USEnglish
Scroll to Top