Archive for the ‘AJAX’ Category

Links Unclickable, Broken in Wordpress Ecommerce Cart Widget (IE)

Friday, June 26th, 2009

We have run into an odd issue of our own when implementing the Wordpress Ecommerce Plugin. We noticed that as the WP Ecommerce plugin uses ajax to build the shopping cart items (which is great, allowing visitors to stay on the page and keep shopping), but the problem was that as soon as an item was added, we found that the shopping cart widget became broken, or rather unclickable in Internet Explorer IE 6.

The Problem

Another IE Bug.  I for one didn’t see this one coming, blindsided.  Wow.  In any case, the problem was that:

Our use of the Transparent PNG fix in IE6 triggered another bug: The cart’s contents were inserted using the innerHtml property.  After the innerHTML was inserted, the hasLayout function wasn’t called – rendering our links unclickable.

The Solution

In order to call the hasLayout function, you need to set the object’s position, or zoom, etc.  The cart function can be found in: /wp-e-commerce/wp-shopping-cart.php.  Line 1018 reads:
document.getElementById('shoppingcartcontents').innerHTML = \"".str_replace(Array("\n","\r") , "",addslashes(nzshpcrt_shopping_basket_internals($cart,$quantity_limit))). "\";
Add the following line immediately below it:
document.getElementById('shoppingcartcontents').style.position = 'relative';