% Response.Expires = 0%>
<%
dim recContents
dim strSQL
dim rs, rsSpec, rsItems, rsCartId, rsCart
dim numItems
dim strColor
dim rsColor
dim action
Dim cat
Dim cartTotal, cartQty, total, upsellQty
Dim i
dim rsUpsell, rsShipping
dim upsell_product_id
dim shippingCost, expressShipping, ship_charge_amt
dim cart_id
dim ship_method_id
call connectdb
If Len(Session("CartId")) = 0 Then
strSQL = "usp_Ins_Cart null, null, null "
con.Execute(strSQL)
rsCartId = con.Execute("SELECT @@identity FROM Cart")
Session("CartId") = rsCartId(0)
End If
cart_id = Session("CartId")
expressShipping = "$20.99"
Call CheckRequestInteger(cart_id)
'get or create the Shopping Cart
strSQL = "SELECT cart_id, p.product_id, product_code, product_status_desc, "
strSQL = strSQL & "cartitem_line_no, p.product_id, isNull(cartitem_upsell_line_no, -1) AS cartitem_upsell_line_no, "
strSQL = strSQL & "product_name, cartitem_qty, cartitem_unit_price, "
strSQL = strSQL & "(cartitem_qty * cartitem_unit_price) 'Total' "
strSQL = strSQL & "FROM CartItem o "
strSQL = strSQL & "JOIN Product p ON (o.product_id = p.product_id) "
strSQL = strSQL & "WHERE cart_id = " & cart_id
strSQL = strSQL & " AND p.product_id < 4 "
strSQL = strSQL & " ORDER BY cartitem_line_no "
Set rsItems = Server.CreateObject("ADODB.Recordset")
rsItems.ActiveConnection = con
rsItems.CursorLocation = 3
rsItems.CursorType = 0
rsItems.LockType = 1
rsItems.Open(strSQL)
'Response.Write(strSQL)
'Response.End()
numItems = rsItems.RecordCount
If numItems = 0 Then
Response.Redirect("emptycart.htm")
End If
'sr 11/27/2002 changed from max() to sum()
strSQL = "SELECT sum(cartitem_ship_charge) FROM Product p "
strSQL = strSQL & "JOIN CartItem c ON p.product_id = c.product_id "
strSQL = strSQL & "WHERE cart_id = " & cart_id
strSQL = strSQL & " AND product_special_yn = 'N'"
Set rsShipping = Server.CreateObject("ADODB.RecordSet")
rsShipping.ActiveConnection = con
rsShipping.CursorLocation = 3
rsShipping.CursorType = 0
rsShipping.LockType = 1
rsShipping.Open(strSQL)
shippingCost = rsShipping(0)
rsShipping.Close
Set rsShipping = nothing
strSQL = "SELECT ship_method_id, cart_ship_charge_amt FROM Cart WHERE cart_id = " & cart_id
Set rsCart = Server.CreateObject("ADODB.RecordSet")
rsCart.ActiveConnection = con
rsCart.CursorLocation = 3
rsCart.CursorType = 0
rsCart.LockType = 1
rsCart.Open(strSQL)
If Not rsCart.EOF Then
ship_method_id = rsCart("ship_method_id")
ship_charge_amt = rsCart("cart_ship_charge_amt")
Else
ship_charge_amt = 0
End If
If isNull(ship_method_id) Then
action = "#"
ElseIf instr(Request.ServerVariables("HTTP_HOST"),"rocketballoons.com") > 0 Then
'action = "checkout.htm?id=" & Session("CartId")
action = "https://www.rocketballoons.com/store/CheckOut.htm"
Else
'action = "https://www.rocketballoons.com/store/CheckOut.htm?id=" & Session("CartId")
action = "checkout.htm"
End If
'action = "checkout.htm?id=" & Session("CartId")
%>
Rocket Balloons - View Cart
|
|
<%
rsItems.Close
Set rsItems = nothing
closeDB()
%>
|
|