Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shopping Cart updating quantities! Pls Help

Status
Not open for further replies.

Fori

Programmer
Jun 18, 2003
84
MT
Hi all

I'm doing a shopping cart, kind of! and i've done everything until the order level. but since quantities can be changed on the order i have an update button! the probelm is that i have no idea how i'm going to loop through each item and updating!

i have a text box named fldQty and a hidden field having the order id!

Thanks
Nick
 
how are u saving the data? ie the special characters etc used. and why not use sessions?

Known is handfull, Unknown is worldfull
 
What do you mean how i'm saving the data?

i'm saving in a temporary table and the following is saved:

temp_id
temp_SessionID
temp_inventoryid
temp_clientId
temp_quantity
temp_price

How should i use sessions in this case!?

Thanks
Nick
 
You need to set up a session array, and use this to store all your data in until the customer confirms the order and it is written to the database. This way, you can manage the order more efficiently.

When the customer presses the "update cart" button, it looks through the quantity boxes and updates the array according to the Product_ID and Quantity.
 
Keep in mind, too, that you don't just have to use PHP basic variable types in session variables. You can store objects in sessions, too.

The only gotcha is that the class of which the object is an instantiation must be defined in the script before session_start() is invoked.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top