Developer forum

Forum » Templates » IE8 redirect issue after addToCart()

IE8 redirect issue after addToCart()

Kasper Skov
Reply

Hi

I'm adding items to the basket by linking to "/Default.aspx?ID=WebshopID&ProductID=PROD666&cartcmd=add&quantity=1" using the javascript function "addToCart()" from the solutionset. It basically builds the url and then redirects. This works fine on pages with the ecom module. However if I try it on my favorite list which is on a page with the customer center module theres an error in IE8.

In IE8 the redirect after the item has been added to the basket is somehow messed up. It redirects to my conditions (a basket subpage). The items are successfully added to the basket. So it redirect fine to the webshop and adds the products. I think the problem is behind the scenes somewhere. 

The issue also accures in the solutionset provided by Dynamicweb (bike shop). I have a feeling there is a "location.href" somwhere. As far as I know, location.href isn't supported in IE8. It needs to be windown.location.href.

It has to be tested in a genuine IE8 browser, and not IE8 simulated through a newer browser like IE11.

You can test it by creating a new user on www.kensk.dk or www.cameleonss.net.dynamicweb-cms.com (solution set), add a product to favorites and try adding it to the basket.


Replies

 
Mikkel Ricky
Reply

IE8 does not set the http refererer header (cf. http://webbugtrack.blogspot.dk/2008/11/bug-421-ie-fails-to-pass-http-referer.html) and therefore you end up on the product page after adding the product from your favorites list. 

As a possible workaround you could try changing the line

, productLink = $productItem.find('.product-link').attr('href') || location.href

in dynamicweb.layout.js to just

, productLink = location.href

Best regards,
Mikkel

 

You must be logged in to post in the forum