<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Shopping Cart at Angel Court <% set Conn = Server.CreateObject("ADODB.Connection") Conn.Open ConString if cstr(Session("orderID")) = "" then Response.Write "
" Response.Write "

Your Cart Is Empty

" Response.Write "

If you previously added items to your order, " Response.Write "your session may have timed out.
" Response.Write "
Continue Shopping

" Response.Write "
" else intOrderID = cstr(Session("orderID")) sqlText = "select products.productID, plu, productName, " _ & "productPrice, wholesalePrice, numInStock, percentOffPrice, quantity, options from products, " _ & "itemsOrdered where " _ & "products.productID = itemsOrdered.productID "_ & "and itemsOrdered.orderID = " & intOrderID %>

Review Your Order

Please review your order for accuracy. To remove an item, set the quantity to zero and press Update Order button.

<% If Session("ValidatedWholesaleUser") = False Then Else End If %> <% intCount=1 set rsReview = Conn.Execute(sqlText) while not rsReview.EOF productID = rsReview("productID") plu = rsReview("plu") strProdName = rsReview("productName") strOptions = rsReview("options") intProdPrice = rsReview("productPrice") intWholesalePrice = rsReview("wholesalePrice") intNumInStock = rsReview("numInStock") intPercentOff = rsReview("percentOffPrice") intQuant = rsReview("quantity") If Session("ValidatedWholesaleUser") = FALSE Then if intPercentOff > 0 then intProdPrice = (intProdPrice-intPercentOff/100*intProdPrice) else intProdPrice = intProdPrice end if Else intProdPrice = intWholesalePrice End If If strOptions = "Gift wrapped ($8.00)" Then intProdPrice = intProdPrice + 8 intTotal = intTotal + (intQuant * intProdPrice) %> <% intCount =intCount+1 rsReview.MoveNext wend rsReview.Close set rsReview = Nothing VerifyCoupon() %>
Quantity Product Name Options Unit Price Extended Price
<% if strOptions <> "" then %> <% end if %>  <%= strProdName %>  <%= strOptions %> $<%= formatNumber(intProdPrice, 2) %> $<%= formatNumber((intQuant * intProdPrice), 2) %>
Total: $<%= formatNumber(intTotal,2) %>
<% If Session("ValidatedWholesaleUser") = FALSE Then %> <% else %> <% End If %>

<% end if Conn.Close set Conn = Nothing %>
<% Public Sub VerifyCoupon() Dim sSql, oRsCoupon, nAmount sSql = "SELECT * FROM tblCoupon c, orders o WHERE c.couponCode=o.couponCode AND orderID=" & Session("orderID") Set oRsCoupon = Server.CreateObject("ADODB.Recordset") With oRsCoupon .ActiveConnection = ConString .Source = sSql .CursorLocation = 2 .CursorType = 0 .LockType = 1 .Open() End With If oRsCoupon.EOF Then Exit Sub If CDbl(intTotal) < CDbl(oRsCoupon("couponCondition")) Then Response.Write("Coupon will activate at " & FormatCurrency(oRsCoupon("couponCondition")) & ".") Exit Sub End If If oRsCoupon("couponType") = "amount" Then intTotal = CDbl(intTotal) - CDbl(oRsCoupon("couponAmount")) nAmount = "-" & FormatCurrency(oRsCoupon("couponAmount")) Else intTotal = CDbl(intTotal) - CDbl(oRsCoupon("couponAmount"))/100 * CDbl(intTotal) nAmount = oRsCoupon("couponAmount") & "% Off" End if Response.Write("Coupon (" & oRsCoupon("couponName") & ")") Response.Write("" & nAmount & "") oRsCoupon.Close() Set oRsCoupon = Nothing End Sub %>