cancel
Showing results for 
Search instead for 
Did you mean: 

Add button on category page - go to product page?

SOLVED

Add button on category page - go to product page?

Hi

Is it possible to, when clicking the Add to cart button on the category page, to go to the product detail page instead of adding the product to the cart? On the product page the button should of course add the product to the cart.

 

I have tried fixing it in the admin by setting the minimum quantity på 0 (zero), but it still add 1 product to the cart.

 

Best,

Magnus

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Add button on category page - go to product page?

I think you should change some code lines:

You find button add to cart:

 I use rwd package.

#app/design/frontend/rwd/default/template/catalog/product/list.phtml

 

 <?php echo $this->getAddToCartUrl($_product) ?>

 

And change to:

 

<?php echo $_product->getProductUrl() ?>

 

Hope this works for you.

Problem solved? Click Accept as Solution!

View solution in original post

5 REPLIES 5

Re: Add button on category page - go to product page?

I think you should change some code lines:

You find button add to cart:

 I use rwd package.

#app/design/frontend/rwd/default/template/catalog/product/list.phtml

 

 <?php echo $this->getAddToCartUrl($_product) ?>

 

And change to:

 

<?php echo $_product->getProductUrl() ?>

 

Hope this works for you.

Problem solved? Click Accept as Solution!

Re: Add button on category page - go to product page?

Thanks!

I will try this.

 

// Magnus

Re: Add button on category page - go to product page?

Hi Brake6,

 

My code lines doesn't solve your problem? If still not ok, I will try to find an other way.

Problem solved? Click Accept as Solution!

Re: Add button on category page - go to product page?

Hi MrKhoa99

 

First, I'm very sorry for a late reply.

 

Second, the solution was so simple so I missed it totally. In the category list file (app/design/frontend/my-theme/default/template/catalog/product/list.phtml) just change the onclick event for the add-to-cart button to (around line #89):

 

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $_product->getProductUrl() ?>')"><span><span><?php echo $this->__('View product') ?></span></span></button>

 

It's the same link as on the images a-tag.

 

// Magnus

Re: Add button on category page - go to product page?

Hello Brake6,

 

Yes, my solution is also very simple.

Problem solved? Click Accept as Solution!