Magento 1.9 – Add to Cart Button Not Working on Product List Page

magento-1.9product-list

I've just upgraded from 1.6.2.0 to the latest 1.9.2.4. I've noticed an issue on product list pages, where the Add to Cart button now doesn't actually add the product to the cart – it simply takes you to the product detail page.

This is because in the onclick event the query string (options=cart) is missing. I have tracked this down and it seems to be as a result of some changes to Mage_Catalog_Model_Product_Url->getUrl(), whereby a product's URL is generated once and subsequently is retrieved from a stored version. This is an issue because query parameters passed through to that method have no effect!

Here's the onclick event:

onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"

It seems to be identical to the base theme's markup.

Am I missing something or is this a bug? And what would be the best way of remedying it?

Best Answer

if the product is configurable product or you set custom option on the product than it redirect to the product view page. you check this things.