% Dim shipcharges 'shipcharges= session("shipcharge") 'Response.write session("shipcharge") If Session("customerid") = "" Then Response.Redirect "error.asp?msg=" & Server.URLEncode ("We did not find your information, please fill the needed information again.") End If scartItem = Session("cartItem") arrCart = Session("MyCart") msg = Request.QueryString ("msg") if scartItem = 0 then Response.Redirect "error.asp?msg=" & Server.URLEncode ("Your cart is empty: cannot check out.") end if sqlCustomer = "SELECT * FROM customers WHERE custID = " & CInt(Session("customerid")) call openConn() Set rs = Server.CreateObject ("adodb.Recordset") rs.Open sqlCustomer, dbc, adOpenForwardOnly, adLockReadOnly, adCmdText If rs.EOF then Response.Redirect "customer.asp?msg=" & Server.URLEncode("Please fill in your information again.") End If 'procedure builds Cart contents table - isubTotal is the return value for the total sub showCartOut(isubTotal) 'double quote character q = chr(34) strHTML = strHTML & "
| Product code | " strHTML = strHTML & "Product name | " strHTML = strHTML & "Quantity | " strHTML = strHTML & "Unit Price | " strHTML = strHTML & "Total |
| " & arrCart(cProductCode,i) &" | " strHTML = strHTML & "" & arrCart(cProductname,i) & " | " strHTML = strHTML & "" strHTML = strHTML & " | " & FormatCurrency(arrCart(cUnitPrice,i),2) & " | " strHTML = strHTML & "" & FormatCurrency(arrCart(cUnitPrice,i) * arrCart(cQuantity,i),2) & " | " strHTML = strHTML & "
| " strHTML = strHTML & " | Sub-total | " strHTML = strHTML & "" & FormatCurrency(isubtotal,2) & " | " strHTML = strHTML & "||
| " strHTML = strHTML & " | Shipping Charges | " strHTML = strHTML & "" & FormatCurrency(inttax,2) & " | " strHTML = strHTML & "||
| " strHTML = strHTML & " | Total | " strHTML = strHTML & "" & FormatCurrency(isubtotal,2) & " | " strHTML = strHTML & "