Forums
This topic is locked
Charon cart
Posted 25 Jun 2002 07:28:09
1
has voted
25 Jun 2002 07:28:09 Vivian Eersels posted:
I have problems with the charon cart:It DON'T save the cart to the database.
Who can check my code please?
My code:
'
'Insert record into Orders recordset when form is submitted
'and store the unique OrderID
'
CC_OrderAction=Request.ServerVariables("SCRIPT_NAME"

if Request("CC_OrderInsert"

TimeKey=GetTimeInMillisec()
rsOrders.AddNew
rsOrders("datum"

For Each fld in rsOrders.Fields
if Len(Request(fld.Name)) > 0 then
fld.Value = Request(fld.Name)
end if
Next
rsOrders.Update
rsOrders.Requery
rsOrders.Filter= "datum='" & TimeKey & "'"
Session("OrderID"


end if
%>
<%
'
'**Save cart to OrderDetails table in Database**
'
if Request("CC_OrderInsert"

'Bindingvalues=("ProductID,Quantity,Name,Price,< not saved >,"

UniqueIdValue=Session("OrderID"

UniqueIdColumn="orderID"
CC_RedirectURL="reviewOrder.asp"
sub SaveToDatabase(ODRecordset)
ODRecordset.AddNew
ODRecordset.Fields(UniqueIdColumn)=UniqueIdValue
ODRecordset.Fields("ProductID"

ODRecordset.Fields("Quantity"

ODRecordset.Fields("Name"

ODRecordset.Fields("Price"

rsOrders.Update
end sub
for i=0 to ubound(CCcart,2)
if CCcart(CC_ProductID,i) <> "" then
Call SaveToDatabase(rsOrders)
end if
next
Response.Redirect "reviewOrder.asp"
end if
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsOrders_numRows = rsOrders_numRows + Repeat1__numRows