Page 1 of 1

Can't Add to Cart in IE 8 and FireFox

Posted: Wed Nov 18, 2009 12:15 pm
by Mike718NY
Strange problem.
I just upgraded to Internet Explorer 8 (from 6) and get this error
("error on page" on the status bar) when clicking "Add To Cart":

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0;
.NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727)

Message: Sys.WebForms.PageRequestManagerServerErrorException:
The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Baskets_ac_BasketItems_FK1".

The conflict occurred in database "DCPAC7", table "db_owner.ac_Baskets", column 'BasketId'.
The statement has been terminated.
Line: 4723 Char: 21 Code: 0
URI: http://localhost/DCPAC7/ScriptResource.axd?d= vzABqXcf3P ...... 2v1xBcUYG-- .............


I also have the same problem in FireFox : it just won't add the item to the cart (but no error msg).

But, . . I can Add to Cart from the Category products page (ex: /Accessories-C3.aspx).
It's only when I'm on that Products page (ex: /All-in-One-Printer-P33C2.aspx).

And finally, after I Add something to the cart, . . this problem goes away
and I can Add items from the Product pages. ?????

Anyone know why this is happening?

Re: Can't Add to Cart in IE 8 and FireFox

Posted: Wed Nov 18, 2009 12:40 pm
by jmestep
Yes, and there is a patch for it. It doesn't have anything to do with the browser- it is a bug in 7.0.3 and has to do with not having a basket initialized on the product add to cart.
http://help.ablecommerce.com/upgrades/a ... _7.0.3.htm
Down at the bottom- bug 8411.

Re: Can't Add to Cart in IE 8 and FireFox

Posted: Thu Nov 19, 2009 12:26 pm
by Mike718NY
thanks Judy,

I have made a lot of changes to BuyProductDialog.ascx.cs and not looking
for foward to comparing every line :roll:
Do you know off hand if it's just a few lines I need to change?

Re: Can't Add to Cart in IE 8 and FireFox

Posted: Thu Nov 19, 2009 1:13 pm
by Mike718NY
It appears to be just one line:

Basket basket = Token.Instance.User.Basket;
basket.Items.Add(basketItem);
// this one:
basket.Save();
// was : basketItem.Save();

They should have put this note in the fixes section for people who have modified this
file. No need to check every line when it's just one.