Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: RE: shopping cart quantities.....


Message #1 by Robert Chartier <Robert.Chartier@T...> on Mon, 26 Jun 2000 14:15:49 -0700
my recomendation would be to NOT use cookies to store the shopping
experience.  With any good HTTP application it is best kept at the server
because of the numerous disadvantages of cookie storage.

-Rob



-----Original Message-----
From: Phil Perks [mailto:philp@w...]
Sent: Tuesday, June 20, 2000 2:43 AM
To: professional php
Subject: [pro_php] shopping cart quantities.....


-----Original Message-----
From: Deron Pardue [mailto:dpardue@d...]
Sent: 19 June 2000 23:00
To: support@w...
Subject: Prpfessional PHP Programming 2963

I am using Case Study 1 as a model for a shopping cart I'm currently 
writing in PHP.  I'm having problems with the quantities.

After displaying the cart when I have added items, changing quantities 
works fine; but if want to add more items after displaying the cart, the 
quantities get mixed up with different items .  For example:
Initial Display Cart:
  Item A --- Quantity =  4
  Item B --- Quantity = 2
  Item C--- Quantity = 5
If I delete item C by changing the quantity to 0:
  Item A --- Quantity = 4
  Item B -- Quantity = 2
I add another item and it does something like this
 New Item -- Quantity = 4      (should be quan = 1)
 Item A --- Quantity = 2          (should be quan = 4)
Item B --- Quantity = 1           (should be quan = 2)

In other words, it doesn't keep the arrays for items and quantities in the 
same order.  HELP!  This seems happen only after deleting some items when 
displaying the cart.  I could only allow items to be deleted after all 
purchases are made, but customers won't like this at all.

Also if I logout and login as another user, the quantity of the first item 
will equal the quantity of an item from a previous session.

I assume there is a problem in how the quantity array is being stored in a 
cookie, but I can't seem to find a solution.

Thanks!!!

Deron Pardue
dpardue@d...

---
Wrox Professional Wireless Developer Conference, Amsterdam, July 10-12.
Covering application of WAP, XML, ASP, Java and C++ to wireless computing,
choose from 40+ technical sessions delivered by industry experts:
http://www.wroxconferences.com/ConferenceHome.asp?ConfID=9

  Return to Index