<% 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

<% Do While Not rsItems.EOF cartTotal = rsItems("Total") cartQty = rsItems("cartitem_qty") %> <% strSQL = "SELECT cart_id, p.product_id, product_code, product_status_desc, product_special_yn, " strSQL = strSQL & "cartitem_line_no, p.product_id, o.color_code, 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 JOIN Product p ON (o.product_id = p.product_id) " strSQL = strSQL & "WHERE cartitem_line_no = " & rsItems("cartitem_upsell_line_no") strSQL = strSQL & " AND cart_id = " & cart_id Set rsUpsell = Server.CreateObject("ADODB.RecordSet") rsUpsell.ActiveConnection = con rsUpsell.CursorLocation = 3 rsUpsell.CursorType = 0 rsUpsell.LockType = 1 rsUpsell.Open(strSQL) If request.ServerVariables("REMOTE_ADDR") = "4.35.67.115" Then ' Response.Write strSQL End If If Not rsUpsell.EOF Then upsell_product_id = rsUpsell("product_id") %> <% cartTotal = cartTotal + rsUpsell("Total") cartQty = cartQty + rsUpsell("cartitem_qty") End If rsUpsell.Close Set rsUpsell = nothing If upsell_product_id = 5 AND rsItems("product_id") = 2 Then%> <%End If%> <%If rsItems("product_id") = 3 AND 0 > 1 Then%> <%End If%> <%If upsell_product_id = 7 AND rsItems("product_id") = 3 Then%> <%End If%> <%If upsell_product_id = 5 AND rsItems("product_id") = 1 Then%> <%End If%> <% total = total + cartTotal rsItems.MoveNext Loop %>
Item Description Quantity Unit Total  
<%=rsItems("product_code")%> <%=rsItems("product_name")%> " value="<%=rsItems("cartitem_qty")%>"> <%=FormatCurrency(rsItems("cartitem_unit_price"))%> <%=FormatCurrency(rsItems("Total"))%> &pid=<%=rsItems("product_id")%>" class="smallblacktext">Delete
<%=rsUpsell("product_code")%>* <%=rsUpsell("product_name")%> <%=FormatCurrency(rsUpsell("cartitem_unit_price"))%> <%=FormatCurrency(rsUpsell("Total"))%>  
*For every Fun Set you purchase and pay regular shipping, you can purchase 2 additional Fun Sets with no additional shipping cost.

*Refill packs out of stock until July 15th, 2004

*For every Refill Pack you purchase and pay regular shipping, you can purchase 5 additional Refill Packs with no additional shipping cost.

*For every TV Special Offer you Purchase you are eligible to purchase 2 Fun Sets at our reduced bonus price.
    Qty: <%=cartQty%>   <%=FormatCurrency(cartTotal)%>  
         
           
<% If shippingCost <= 0 Then shippingCost = "Free" Else shippingCost = FormatCurrency(shippingCost) End if If expressShipping <= 0 Then expressShipping = "Free" Else expressShipping = FormatCurrency(expressShipping) End if %>
Sub Total: <%=FormatCurrency(total)%>
Tax (CT Residents add 6%): -
Shipping:
Total: <%=FormatCurrency(total + ship_charge_amt)%>

<% If total = 0 Then action = "#" End If %>
<% rsItems.Close Set rsItems = nothing closeDB() %>