Cart empties after 18 line items are added

Get help with nopcart intergration with ASP and related issues

Moderator: Koibito

Cart empties after 18 line items are added

Postby lwaters » Wed Aug 16, 2006 6:26 pm

I am using the ASP version of NOPcart and The site is password protected so, people must login to access the store. After the person puts from 18 to 20 items in their cart, it logs the person out and empties the cart. Any ideas what is causing this? I have a session variable set on every page for 60 minutes. Thanks.
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm

Re: Cart empties after 18 line items are added

Postby Koibito » Wed Aug 16, 2006 7:16 pm

lwaters wrote:I am using the ASP version of NOPcart and The site is password protected so, people must login to access the store. After the person puts from 18 to 20 items in their cart, it logs the person out and empties the cart. Any ideas what is causing this? I have a session variable set on every page for 60 minutes. Thanks.


The problem here is the number of cookies. The absolute maximum number of cookies for a given domain is 20.

The maximum number of items in your cart should be no more than 15 to 17. ASP probably needs cookies too to maintain state.

In the AddToCart function, change this: if inumberOrdered > 15
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Add more than 18 line items - session ends

Postby lwaters » Wed Aug 16, 2006 7:35 pm

So, if I change that one line, they will be able to add as many line items as they would like? Thanks
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm

Postby lwaters » Wed Aug 16, 2006 7:36 pm

Is the add to cart funtion in the nopcart.js file?
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm

Re: Add more than 18 line items - session ends

Postby Randy » Wed Aug 16, 2006 9:46 pm

lwaters wrote:So, if I change that one line, they will be able to add as many line items as they would like? Thanks


The maximum number of cookies any one domain can set is 20.
the 21st cookie will overwrite the first.
Ususally the first cookie nopcart writes is NumberOrdered. Each item ordered writes a cookie. So 1 item requires 2 cookies, 2 items needs 3, etc. With NumberOrdered overwritten, the cart would appear empty.

Depending upon how many cookies ASP requires, you can up the item count from 12 to 17 or 18. Test it out, if it crashes, then cut the number down. When you do increase it from 12 items in AddToCart function, you must also add the necessary variables to checkout.php or .pl so they will show up in the email and CSV order form.

Randy
JRS SERVICES
e-commerence solutions
www.jrsservices.net
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Postby lwaters » Wed Aug 16, 2006 11:56 pm

That didn't work. I actually had it set to > 50, and then I tried >17 and then I got the sorry your cart is full please goto checkout. The sorry message isn't what is happening. What is happening is that the shopping cart empties and the person is logged out of the web site (it s a password restricted site). Any other suggestions? Thanks
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm

Postby Koibito » Thu Aug 17, 2006 12:39 am

lwaters wrote:That didn't work. I actually had it set to > 50, and then I tried >17 and then I got the sorry your cart is full please goto checkout. The sorry message isn't what is happening. What is happening is that the shopping cart empties and the person is logged out of the web site (it s a password restricted site). Any other suggestions?


Try a value of 12 first. If ASP maintains state using cookies, you'll need to substract the number of "ASP cookies" from the maximum value of 20.

You said that persons are suddenly logged out of a protected area. This suggests that the "ASP cookies" are overwritten by a "shopping cart cookies". A web browser will let you add cookies, but it will delete the older ones before it sets a new one. The maximum will always be 20 for a specific domain.
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Postby lwaters » Thu Aug 17, 2006 2:35 am

I tried that and after 12 line items, it says the cart is full. I want people to be able to buy an infinite amount of products.
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm

Postby Koibito » Thu Aug 17, 2006 12:18 pm

lwaters wrote:I tried that and after 12 line items, it says the cart is full. I want people to be able to buy an infinite amount of products.


That is not possible. There will be a cookie for every item in your shopping cart, and the maximum number of cookies for a specific domain is 20.

I am using the following:

Code: Select all
if ( iNumberOrdered > 18 )
alert( strSorry );

strSorry = "I'm Sorry, your cart is full, please proceed to checkout.\n\nOur shopping cart cannot contain more than 18 items.\nWe are sorry for the inconvenience.";


For you, a value of 18 might be too high, because ASP also uses some of those 20 cookies.

Based on my experience, I can say that you should not use a value higher than 18. With a value of 19, web browsers will crash. Some browsers even have problems with a value of 17.
John
Koibito
Site Admin / Guru
 
Posts: 918
Joined: Sun May 28, 2006 1:59 am
Location: New Jersey, USA

Postby Randy » Thu Aug 17, 2006 12:56 pm

lwaters wrote:That didn't work. I actually had it set to > 50, and then I tried >17 and then I got the sorry your cart is full please goto checkout. The sorry message isn't what is happening. What is happening is that the shopping cart empties and the person is logged out of the web site (it s a password restricted site). Any other suggestions? Thanks


So the real problem is that the password cookie is overwitten, and people are dumped from the site. This in turn will empty the cart, because they are only session cookies.

From what you say it works at 17 items.
Your cookies count up like this: 1 for NumberOrdered + 17 for ordered items + 1 Password = 19. As you know, the maximum number of cookies allowed is 20, so I would leave it at 17 rather than try to squeeze one more item into the cart.

You can tell them to checkout that cartful and come back for another load.
I use a cookie to keep track of the information in the checkout form, so the next time they place an order checkout is filled in for them.


Enjoy!
Randy
JRS SERVICES
e-commerence solutions
www.jrsservices.net
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

accomplishing infinite items

Postby loosecannon12 » Mon Oct 09, 2006 3:37 pm

javascript based shopping carts do have there downfall... try asp and an Access database.... you could make it work somehow with nopcart.... somehow.................. :shock: :shock: :shock:
Just Another Kid.
loosecannon12
 
Posts: 4
Joined: Mon Oct 02, 2006 2:01 am

Postby lwaters » Tue Oct 10, 2006 12:10 pm

That is what I am using is ASP and an access database with NopCart as the cart but, it still doesn't work and I am not a programmer so, I am not sure how to do it. Thanks.
lwaters
WebMaster
 
Posts: 65
Joined: Wed Jul 16, 2003 8:44 pm


Return to Help: ASP & NOPCart

Who is online

Users browsing this forum: No registered users and 0 guests

cron