<% Response.Buffer = True %> <% Response.Expires = -1 %> <% Const adOpenKeyset = 1 Const adLockOptimistic = 3 Dim strListNum strListNum = Request("ListNum") Dim strQuantity strQuantity = Request("Quantity") Dim strPrice strPrice = Request("Price") Dim strItemTotal strItemTotal = Request("Price") * Request("Quantity") DIM mySQL, objRS Set objRS = Server.CreateObject("ADODB.Recordset") mySQL = "SELECT * FROM Cart Where ListNum = " & strListNum & "" objRS.Open mySQL, objConn Dim strOnSale strOnSale = objRS("OnSale") Dim strHandling strHandling = objRS("Handling") Dim strBaseShipping strBaseShipping = objRS("BaseShipping") Dim strTotalShipping strTotalShipping = strBaseShipping * strQuantity Dim strFlatRate strFlatRate = strTotalShipping + strHandling Dim strBaseWeight strBaseWeight = objRS("BaseWeight") Dim strTotalWeight strTotalWeight = strQuantity * strBaseWeight Dim strPriceSetId strPriceSetId = Request("PriceSetId") If strOnSale = "Yes" Then Else If (strPriceSetId <> "None" And IsNumeric(strPriceSetId)) Then DIM mySQLPrice, objRSPrice mySQLPrice = "SELECT * FROM PriceSets Where Id = " & strPriceSetId & "" Set objRSPrice = Server.CreateObject("ADODB.Recordset") objRSPrice.Open mySQLPrice, objConn, 1, 3 Dim strQuantity2, strQuantity3, strQuantity4, strQuantity5, strQuantity6, strQuantity7, strQuantity8, _ strQuantity9, strQuantity10, strQuantity11, strQuantity12 strQuantity2 = objRSPrice("Quantity2") If strQuantity2 = "" Then strQuantity2 = 0 End If strQuantity3 = objRSPrice("Quantity3") If strQuantity3 = "" Then strQuantity3 = 0 End If strQuantity4 = objRSPrice("Quantity4") If strQuantity4 = "" Then strQuantity4 = 0 End If strQuantity5 = objRSPrice("Quantity5") If strQuantity5 = "" Then strQuantity5 = 0 End If strQuantity6 = objRSPrice("Quantity6") If strQuantity6 = "" Then strQuantity6 = 0 End If strQuantity7 = objRSPrice("Quantity7") If strQuantity7 = "" Then strQuantity7 = 0 End If strQuantity8 = objRSPrice("Quantity8") If strQuantity8 = "" Then strQuantity8 = 0 End If strQuantity9 = objRSPrice("Quantity9") If strQuantity9 = "" Then strQuantity9 = 0 End If strQuantity10 = objRSPrice("Quantity10") If strQuantity10 = "" Then strQuantity10 = 0 End If strQuantity11 = objRSPrice("Quantity11") If strQuantity11 = "" Then strQuantity11 = 0 End If strQuantity12 = objRSPrice("Quantity12") If strQuantity12 = "" Then strQuantity12 = 0 End If strPrice = objRSPrice("Price1") If objRSPrice("Quantity2") <> "" Then If Abs(strQuantity) => Abs(strQuantity2) Then strPrice = objRSPrice("Price2") End If End If If objRSPrice("Quantity3") <> "" Then If Abs(strQuantity) => Abs(strQuantity3) Then strPrice = objRSPrice("Price3") End If End If If objRSPrice("Quantity4") <> "" Then If Abs(strQuantity) => Abs(strQuantity4) Then strPrice = objRSPrice("Price4") End If End If If objRSPrice("Quantity5") <> "" Then If Abs(strQuantity) => Abs(strQuantity5) Then strPrice = objRSPrice("Price5") End If End If If objRSPrice("Quantity6") <> "" Then If Abs(strQuantity) => Abs(strQuantity6) Then strPrice = objRSPrice("Price6") End If End If If objRSPrice("Quantity7") <> "" Then If Abs(strQuantity) => Abs(strQuantity7) Then strPrice = objRSPrice("Price7") End If End If If objRSPrice("Quantity8") <> "" Then If Abs(strQuantity) => Abs(strQuantity8) Then strPrice = objRSPrice("Price8") End If End If If objRSPrice("Quantity9") <> "" Then If Abs(strQuantity) => Abs(strQuantity9) Then strPrice = objRSPrice("Price9") End If End If If objRSPrice("Quantity10") <> "" Then If Abs(strQuantity) => Abs(strQuantity10) Then strPrice = objRSPrice("Price10") End If End If If objRSPrice("Quantity11") <> "" Then If Abs(strQuantity) => Abs(strQuantity11) Then strPrice = objRSPrice("Price11") End If End If If objRSPrice("Quantity12") <> "" Then If Abs(strQuantity) => Abs(strQuantity12) Then strPrice = objRSPrice("Price12") End If End If strItemTotal = strPrice * strQuantity End If End If objConn.Execute "Update Cart Set Quantity = "& strQuantity &", Price = "& strPrice &", ItemTotal = "& strItemTotal &", TotalShipping = "& strTotalShipping &", FlatRate = "& strFlatRate &", TotalWeight = "& strTotalWeight &" Where ListNum = "& strListNum &"" Response.Redirect"cart_view.asp" %>