shopping cart problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i just finished creating an asp.net application named booksApp.

during the testing phase uploaded live ( ex: www.bookies.com) , i tried to
purchase something and add it to my shopping cart.

then, i tried opening the application on a different client computer. I just
randomly checked the shopping cart and there i found the same items i added
to my cart on the first computer.

all i did using to add to my cart was session("cart").

how can i just save the contents of the current cart to the current machine
being used?

thanks a million guys!
 
all i did using to add to my cart was session("cart").

You must have done something different, can you post some relevant code?
You're not using shared (vb) / static (c#) variables anywhere are you?
 
i just finished creating an asp.net application named booksApp.

Yesterday, you'd just finished creating an application called 'teddybears' -
you are a busy person, aren't you...? :-)

Which application will you just have finished tomorrow, I wonder...?
 
You're not using shared (vb) / static (c#) variables anywhere are you?

He certainly is - see his virtually identical post from yesterday - only the
names have been changed to protect the innocent, etc...;-)
 
hi, thats the same guy :)

i changed it coz its hard to find my old post ...

anyways, heres the code (again)

Dim ala As New ShoppingCart

If Not IsNothing(Session("shoppingcart")) Then
ala = Session("shoppingcart")
End If

Dim objCartItem As New cartitem
Dim intItems As Integer

objCartItem.itemcode = seqid
objCartItem.itemname = seqname
objCartItem.qty = Qty
objCartItem.ddate = eventDate
objCartItem.unitprice = unit
objCartItem.total = objCartItem.unitprice * objCartItem.qty

ala.addCartItem(objCartItem)
Session("cartcount") = ala.CountItemsinCart.ToString
Session("shoppingcart") = ala

----------------------------------------------------------
on Global.vb class:
----------------------------------------------------------
Public _ItemsinCart As New Collections.ArrayList

----------------------------------------------------------
on a separate class called ShoppingCart.vb :
----------------------------------------------------------
Public Structure cartitem

Public itemcode As String
Public itemname As String
Public ddate As DateTime
Public unitprice As Decimal
Public total As Decimal
Public coupon As String
Public grandtotal As Decimal
Public qty As Long
Public schedulecode As String
End Structure


Public Sub addCartItem(ByVal item As cartitem)
If Not isItemExists(item) Then
_ItemsinCart.Add(item)
End If
End Sub
 
Back
Top