7.0.3 Add to cart bug (maybe)
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
7.0.3 Add to cart bug (maybe)
Would someone else test the following procedure? If we don't have the minibasket on a product page, and click to add a product to the cart, it doesn't get added. Then if I go to the cart - nothing is there- and come back to to the product, we can add the product. My test 14458 has that problem, a store that upgraded from 7.0.2 to 7.0.3 and went live today has the problem- it didn't have it in 7.0.2.
Here is what I do
Take any scriplets out of nav display on product page if they have the minibasket in them.
Clear cookies in the browser
Go to product page and try to add to cart. I've clicked up to 10 times and it doesn't get added.
Go to basket page -- nothing in cart
Go back to product page and try to add again-- it works this time.
My test site doesn't show an error, but the live site shows:
The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Baskets_ac_BasketItems_FK1". The conflict occurred in database "xxx", table "dbo.ac_Baskets", column 'BasketId'.
Thanks
Here is what I do
Take any scriplets out of nav display on product page if they have the minibasket in them.
Clear cookies in the browser
Go to product page and try to add to cart. I've clicked up to 10 times and it doesn't get added.
Go to basket page -- nothing in cart
Go back to product page and try to add again-- it works this time.
My test site doesn't show an error, but the live site shows:
The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Baskets_ac_BasketItems_FK1". The conflict occurred in database "xxx", table "dbo.ac_Baskets", column 'BasketId'.
Thanks
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
I was able to fix this by putting the basket.Package(true) in this code block. I haven't completely tested to make sure it caused other problems, but I think this is a bug and if someone else can confirm it, I will put in a bug report.
Edit: This was done in the BuyProductDialog.ascx.cs
Code: Select all
// THERE ARE NO AGREEMENTS, SO SAVE THIS ITEM INTO THE BASKET
Basket basket = Token.Instance.User.Basket;
basket.Items.Add(basketItem);
basket.Package(true);
basketItem.Save();
Last edited by jmestep on Mon Jul 13, 2009 1:22 pm, edited 1 time in total.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
There seems to be something wrong, Judy after case reproduction could you check your error log and post information here if there is any? For me its reporting FOREIGN KEY problem.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
I posted a bug on it and mentioned that we fixed it putting basket.Package(true) into the code.
I wasn't getting popup error messages on my test site, just nothing was happening. I just checked the error log and it was the same errors I was getting on the live site.
I wasn't getting popup error messages on my test site, just nothing was happening. I just checked the error log and it was the same errors I was getting on the live site.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
Thanks Judy
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
I know there is a bug report, but I can't post to it. I just found an error on a 7.0.2 store that did have the basket.Package(true) code in the BuyProductDialog, but still got the error. Or maybe it's a new one.
Could not calculate with the configured tax provider.
Could not calculate with the configured tax provider.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
I really do not want the minibasket because I offer engraving and when a customer types in engraving the minibasket doesn't wrap the text and it can make it extend all across the width of the page. So, I removed it from the right sidebar.
Now, when I try adding an item to the basket it throws an error and I get this message in the Admin.
Exception of type 'System.Web.HttpUnhandledException' was thrown.; The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Baskets_ac_BasketItems_FK1". The conflict occurred in database "(mydbname)", table "dbo.ac_Baskets", column 'BasketId'. The statement has been terminated.
Does Judy's fix above work or is there a fix I can do myself without having to wait for a release?
Now, when I try adding an item to the basket it throws an error and I get this message in the Admin.
Exception of type 'System.Web.HttpUnhandledException' was thrown.; The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Baskets_ac_BasketItems_FK1". The conflict occurred in database "(mydbname)", table "dbo.ac_Baskets", column 'BasketId'. The statement has been terminated.
Does Judy's fix above work or is there a fix I can do myself without having to wait for a release?
AC 7.0.3 build 13937
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
I couldn't post this to the bug report, but I found out that it doesn't happen if customer is logged in before adding to basket.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
Judy,
I was told by my developer that the line of code you posted was supposed to be there and had been there up to 7.0.2 and that it somehow got left out of 7.0.3. He added it back and everything is working fine on my end so far.
Thank you.
I was told by my developer that the line of code you posted was supposed to be there and had been there up to 7.0.2 and that it somehow got left out of 7.0.3. He added it back and everything is working fine on my end so far.
Thank you.
AC 7.0.3 build 13937
- AlexG
- Commander (CMDR)
- Posts: 128
- Joined: Mon Mar 03, 2008 9:51 pm
- Location: StealDeals.com
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
Hi jmestep,
I've the same error!
Did you fixed that error in your web store (7.0.3)?
If yes, Can you explain me how to do this?
Thanks,
Alex
I've the same error!
Did you fixed that error in your web store (7.0.3)?
If yes, Can you explain me how to do this?
Thanks,
Alex
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
Yes, the same way as above:
// THERE ARE NO AGREEMENTS, SO SAVE THIS ITEM INTO THE BASKET
Basket basket = Token.Instance.User.Basket;
basket.Items.Add(basketItem);
basket.Package(true);
basketItem.Save();
Edit: This was done in the BuyProductDialog.ascx.cs
Note- if you have the minibasket in the sidebar, it isn't necessary to do this and it will make the minibasket double the quantities.
// THERE ARE NO AGREEMENTS, SO SAVE THIS ITEM INTO THE BASKET
Basket basket = Token.Instance.User.Basket;
basket.Items.Add(basketItem);
basket.Package(true);
basketItem.Save();
Edit: This was done in the BuyProductDialog.ascx.cs
Note- if you have the minibasket in the sidebar, it isn't necessary to do this and it will make the minibasket double the quantities.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- AlexG
- Commander (CMDR)
- Posts: 128
- Joined: Mon Mar 03, 2008 9:51 pm
- Location: StealDeals.com
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
THANK YOU!
YOU ARE THE BEST!
YOU ARE THE BEST!
jmestep wrote:Yes, the same way as above:
// THERE ARE NO AGREEMENTS, SO SAVE THIS ITEM INTO THE BASKET
Basket basket = Token.Instance.User.Basket;
basket.Items.Add(basketItem);
basket.Package(true);
basketItem.Save();
Edit: This was done in the BuyProductDialog.ascx.cs
Note- if you have the minibasket in the sidebar, it isn't necessary to do this and it will make the minibasket double the quantities.
Re: 7.0.3 Add to cart bug (maybe)
I've added this fix and it solves the insert error. There is one bad side-effect to this (that I've found):
- go to a product, click add to cart
- click keep shopping button to return to same product
- click add to cart again
you now have 3 of these items in the cart instead of 2.
So each add of an already existing item adds 2 more of them to the cart.
Are there any other fixes for this or the insert error?
I'm using 7.0.3.
- go to a product, click add to cart
- click keep shopping button to return to same product
- click add to cart again
you now have 3 of these items in the cart instead of 2.
So each add of an already existing item adds 2 more of them to the cart.
Are there any other fixes for this or the insert error?
I'm using 7.0.3.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
Yes, Able came out with the real fix. Mine was just a hack to get something to work.
Their fix is at help.ablecommerce.com - free patches for 7.0.3
Their fix is at help.ablecommerce.com - free patches for 7.0.3
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
Hmm... I downloaded the BuyProductDialog.ascx.cs patch but I am still experiencing the problem markpuck described
- go to a product, click add to cart
- click keep shopping button to return to same product
- click add to cart again
you now have 3 of these items in the cart instead of 2.
- go to a product, click add to cart
- click keep shopping button to return to same product
- click add to cart again
you now have 3 of these items in the cart instead of 2.
AC 7.0.3 build 13937
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
Did you take the other patches back out?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: 7.0.3 Add to cart bug (maybe)
Hi Judy,
I noticed the patch was one file, I think BuyProductDialog. The only change I saw in mine was the one line of code added so I just overwrote my file with the patched file.
I think it is yet another bug. I am experiencing the same thing markpuck mentions.
I noticed the patch was one file, I think BuyProductDialog. The only change I saw in mine was the one line of code added so I just overwrote my file with the patched file.
I think it is yet another bug. I am experiencing the same thing markpuck mentions.
AC 7.0.3 build 13937
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: 7.0.3 Add to cart bug (maybe)
Did you put any of my patch into your category display page? I think I had on a site originally. If you did, you need to take it back out also.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx