Google+

Pages

Wednesday, July 11, 2012

Magento Fix: Add to Cart button adds the item twice in Internet Explorer

Sometimes in Internet Explorer, when we click on "Add to Cart" button, it adds product twice in the cart. This problem can occur due to many different reasons. Some of quick checks to resolve this problem are:

Solution 1:
Go to:
app/design/frontend/default/default/template/catalog/product/view folder, and copy addtocart.phtml and paste it into app/design/frontend/[your_package]/[your_theme]/template/catalog/product/view folder.

Now find some thing like this:

onclick="productAddToCartForm.submit();"

and replace it with:

onclick="productAddToCartForm.submit(); return false;"

 
Solution 2:
Go to:

app/design/frontend/default/default/template/catalog/product/view folder, and copy addtocart.phtml and paste it into app/design/frontend/[your_package]/[your_theme]/template/catalog/product/view folder.

Now find some thing like this:

onclick="productAddToCartForm.submit();"

and replace it with:

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

Note:Where $_product is object, by which we are getting product information.

Hopefully, one of these will solve your problem.

Enjoy.. :)

2 comments:

Anonymous said...

Thanks, for your help, the 1st solution resolve the problem

Anonymous said...

list.phtml still add wrong number of qty. Can you help to solve this?