Thursday, May 16, 2013

Add to shopping cart not working in ie 8 with Magento

Today I came across a strange problem where in IE 8 when I go to the product detail page and click 'add to cart' , nothing seems to happen. I debugged and found a strange error of which part is
Unable to set property 'href'

I navigated template/catalog/product/view/type/options, with some stuff before it and came to a file called configurable.phtml. I then commented out the following :

var pinit_href = $$('.product-share')[0].firstElementChild.href;
$$('.product-share')[0].firstElementChild.href = pinit_href+"& media="+window['pinit_media_'+params.colour]+"&description="+pinit_desc;


And viola, it seems to work now. This is what I tried after I tried and added
<....meta http-equiv="X-UA-Compatible" content="IE=8" />
Without the dots, to .... template/page/html/head.phtml


The other method is to replace the first code line var pShare = $$('.product-share')[0]; var pinit_href = (pShare.firstElementChild || pShare.children[0] || {}).href;
You can take a look at http://stackoverflow.com/questions/16585976/magento-tech-add-to-shopping-cart-not-working-ie-8 or http://stackoverflow.com/questions/6333249/firstelementchild-doesnt-work-in-internet-explorer-7-what-are-my-options

No comments:

Post a Comment