<% Response.Buffer=true %> Laundry Carts <% Dim CartsConn Dim CartsDB Set CartsConn=Server.CreateObject("ADODB.Connection") CartsConn.Open "DSN=LaundryCarts;" Dim CookCartID CookCartID = Session("CookCartID") CustID = Session("CustID") Dim ZoneArray(2,97) ZoneArray(0,1) = "6" ZoneArray(0,2) = "8" ZoneArray(0,3) = "9" ZoneArray(0,4) = "10" ZoneArray(0,5) = "90" ZoneArray(0,6) = "100" ZoneArray(0,7) = "200" ZoneArray(0,8) = "300" ZoneArray(0,9) = "325" ZoneArray(0,10) = "326" ZoneArray(0,11) = "340" ZoneArray(0,12) = "341" ZoneArray(0,13) = "350" ZoneArray(0,14) = "360" ZoneArray(0,15) = "364" ZoneArray(0,16) = "368" ZoneArray(0,17) = "369" ZoneArray(0,18) = "373" ZoneArray(0,19) = "375" ZoneArray(0,20) = "376" ZoneArray(0,21) = "380" ZoneArray(0,22) = "398" ZoneArray(0,23) = "400" ZoneArray(0,24) = "403" ZoneArray(0,25) = "420" ZoneArray(0,26) = "425" ZoneArray(0,27) = "427" ZoneArray(0,28) = "430" ZoneArray(0,29) = "460" ZoneArray(0,30) = "467" ZoneArray(0,31) = "469" ZoneArray(0,32) = "470" ZoneArray(0,33) = "471" ZoneArray(0,34) = "473" ZoneArray(0,35) = "474" ZoneArray(0,36) = "480" ZoneArray(0,37) = "498" ZoneArray(0,38) = "500" ZoneArray(0,39) = "504" ZoneArray(0,40) = "505" ZoneArray(0,41) = "506" ZoneArray(0,42) = "508" ZoneArray(0,43) = "520" ZoneArray(0,44) = "561" ZoneArray(0,45) = "562" ZoneArray(0,46) = "570" ZoneArray(0,47) = "582" ZoneArray(0,48) = "583" ZoneArray(0,49) = "590" ZoneArray(0,50) = "592" ZoneArray(0,51) = "596" ZoneArray(0,52) = "600" ZoneArray(0,53) = "640" ZoneArray(0,54) = "650" ZoneArray(0,55) = "653" ZoneArray(0,56) = "654" ZoneArray(0,57) = "656" ZoneArray(0,58) = "677" ZoneArray(0,59) = "680" ZoneArray(0,60) = "693" ZoneArray(0,61) = "700" ZoneArray(0,62) = "710" ZoneArray(0,63) = "712" ZoneArray(0,64) = "718" ZoneArray(0,65) = "720" ZoneArray(0,66) = "726" ZoneArray(0,67) = "739" ZoneArray(0,68) = "740" ZoneArray(0,69) = "790" ZoneArray(0,70) = "795" ZoneArray(0,71) = "797" ZoneArray(0,72) = "800" ZoneArray(0,73) = "813" ZoneArray(0,74) = "814" ZoneArray(0,75) = "840" ZoneArray(0,76) = "854" ZoneArray(0,77) = "855" ZoneArray(0,78) = "864" ZoneArray(0,79) = "865" ZoneArray(0,80) = "870" ZoneArray(0,81) = "873" ZoneArray(0,82) = "875" ZoneArray(0,83) = "879" ZoneArray(0,84) = "880" ZoneArray(0,85) = "889" ZoneArray(0,86) = "893" ZoneArray(0,87) = "900" ZoneArray(0,88) = "934" ZoneArray(0,89) = "935" ZoneArray(0,90) = "936" ZoneArray(0,91) = "940" ZoneArray(0,92) = "962" ZoneArray(0,93) = "967" ZoneArray(0,94) = "969" ZoneArray(0,95) = "970" ZoneArray(0,96) = "995" ZoneArray(1,0) = "8" ZoneArray(1,1) = "0" ZoneArray(1,2) = "0" ZoneArray(1,3) = "0" ZoneArray(1,4) = "8" ZoneArray(1,5) = "0" ZoneArray(1,6) = "8" ZoneArray(1,7) = "8" ZoneArray(1,8) = "8" ZoneArray(1,9) = "7" ZoneArray(1,10) = "8" ZoneArray(1,11) = "0" ZoneArray(1,12) = "8" ZoneArray(1,13) = "7" ZoneArray(1,14) = "8" ZoneArray(1,15) = "7" ZoneArray(1,16) = "8" ZoneArray(1,17) = "7" ZoneArray(1,18) = "8" ZoneArray(1,19) = "7" ZoneArray(1,20) = "8" ZoneArray(1,21) = "7" ZoneArray(1,22) = "8" ZoneArray(1,23) = "7" ZoneArray(1,24) = "8" ZoneArray(1,25) = "7" ZoneArray(1,26) = "8" ZoneArray(1,27) = "7" ZoneArray(1,28) = "8" ZoneArray(1,29) = "7" ZoneArray(1,30) = "8" ZoneArray(1,31) = "7" ZoneArray(1,32) = "8" ZoneArray(1,33) = "7" ZoneArray(1,34) = "8" ZoneArray(1,35) = "7" ZoneArray(1,36) = "8" ZoneArray(1,37) = "7" ZoneArray(1,38) = "6" ZoneArray(1,39) = "7" ZoneArray(1,40) = "6" ZoneArray(1,41) = "7" ZoneArray(1,42) = "6" ZoneArray(1,43) = "7" ZoneArray(1,44) = "6" ZoneArray(1,45) = "7" ZoneArray(1,46) = "6" ZoneArray(1,47) = "7" ZoneArray(1,48) = "6" ZoneArray(1,49) = "5" ZoneArray(1,50) = "6" ZoneArray(1,51) = "5" ZoneArray(1,52) = "7" ZoneArray(1,53) = "6" ZoneArray(1,54) = "7" ZoneArray(1,55) = "6" ZoneArray(1,56) = "7" ZoneArray(1,57) = "6" ZoneArray(1,58) = "5" ZoneArray(1,59) = "6" ZoneArray(1,60) = "5" ZoneArray(1,61) = "7" ZoneArray(1,62) = "6" ZoneArray(1,63) = "7" ZoneArray(1,64) = "6" ZoneArray(1,65) = "7" ZoneArray(1,66) = "6" ZoneArray(1,67) = "5" ZoneArray(1,68) = "6" ZoneArray(1,69) = "5" ZoneArray(1,70) = "6" ZoneArray(1,71) = "5" ZoneArray(1,72) = "5" ZoneArray(1,73) = "4" ZoneArray(1,74) = "5" ZoneArray(1,75) = "4" ZoneArray(1,76) = "3" ZoneArray(1,77) = "4" ZoneArray(1,78) = "3" ZoneArray(1,79) = "4" ZoneArray(1,80) = "5" ZoneArray(1,81) = "4" ZoneArray(1,82) = "5" ZoneArray(1,83) = "4" ZoneArray(1,84) = "5" ZoneArray(1,85) = "3" ZoneArray(1,86) = "4" ZoneArray(1,87) = "2" ZoneArray(1,88) = "3" ZoneArray(1,89) = "2" ZoneArray(1,90) = "3" ZoneArray(1,91) = "4" ZoneArray(1,92) = "0" ZoneArray(1,93) = "0" ZoneArray(1,94) = "0" ZoneArray(1,95) = "5" ZoneArray(1,96) = "0" %>
Checkout - Shipping Method

<% Sub GetFormItem(sItemName, sAliasName, iMinLength, iMaxLength, fRequired) varItem = TRIM(Request.Form(sItemName)) If sAliasName = "" Then sAliasName = sItemName If fRequired Then If varItem = "" Then Session("CustomError") = Session("CustomError") _ & "Please enter at least "&iMinLength&" characters in the """ _ & sAliasName & """ field.
" Else If Len(varItem) < iMinLength Then Session("CustomError") = _ Session("CustomError") & "Please enter at least " _ & iMinLength &" characters in the """ _ & sAliasName & """ field.
" If Len(varItem) > iMaxLength Then Session("CustomError") = _ Session("CustomError") & "Please enter at most " _ & iMaxLength &" characters in the """ _ & sAliasName & """ field.
" End If Else varItem = TRIM(Request.Form(sItemName)) End If Session(sItemName) = varItem End Sub CheckCartID = Request.Form("CartID") If CheckCartID = 258 Then Call GetFormItem ("Shipto", "Shipto", 3, 50, True) Call GetFormItem ("SFirstName", "First Name", 3, 50, True) Call GetFormItem ("SLastName", "Last Name", 3, 50, True) Call GetFormItem ("SBusiness", "Business Name", 3, 50, False) Call GetFormItem ("SAddress1", "Shipping Address", 3, 50, True) Call GetFormItem ("SAddress2", "Address2", 3, 50, False) Call GetFormItem ("SCity", "Shipping City", 3, 50, True) Call GetFormItem ("SState", "Shipping State", 2, 4, True) Call GetFormItem ("SZip", "Shipping Zipcode", 5, 10, True) Call GetFormItem ("SPhone", "Shipping Phone", 7, 20, False) End If If Session("CustomError") <> "" Then Response.Write "Error: " & Session("CustomError") & "" Response.Write "
Click here to go back and fix your errors" Session("CustomError") = "" Else %> <% strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Weight, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) Weight = 0 CARTs = 0 CartsCC = 0 Shipcost1 = 0 Shipcost2 = 0 If Not CartsDB.EOF Then Do While NOT CartsDB.EOF PartID = CartsDB("PartID") PartDesc = CartsDB("PartDesc") Quantity = CartsDB("Quantity") Price = CartsDB("Price") Price1 = CartsDB("Price1") WeightD = CartsDB("Weight") Weight = Weight + (Quantity * WeightD) Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" 'Cart Flat Rate Shipping If PartID = "JRCART" OR PartID = "BIGCART" Then CARTS = CARTS + Quantity End If If PartID = "Chrome" Then CARTSCC = CARTSCC + Quantity End If CartsDB.MoveNext Loop CartsDB.Close Set CartsDB = Nothing If Session("SZip") <> "" Then Session("zonecode") = Left(Session("SZip"),3) Place = 96 For i = 0 to 96 If cInt(ZoneArray(0,i)) > cInt(Session("zonecode")) Then Place = i-1 i = 999 End If Next Session("Zone") = ZoneArray(1,Place) Shipcost1 = 0 If CARTS < 25 AND CARTS <> 0 Then strSQL = "SELECT * FROM Shipping WHERE Zone = " & cInt(Session("Zone")) & ";" 'Response.Write strSQL Set ScootsDB = CartsConn.Execute(strSQL) If NOT ScootsDB.EOF Then Shipcost1 = Shipcost1 + ScootsDB(CARTS) 'Response.Write Shipcost1 & ":" Else 'Response.Write "
Bad Session" End If ScootsDB.Close Set ScootsDB = Nothing End If If CARTSCC < 25 AND CARTSCC <> 0 Then strSQL = "SELECT * FROM ShippingCC WHERE Zone = " & cInt(Session("Zone")) & ";" 'Response.Write strSQL Set ScootsDB = CartsConn.Execute(strSQL) If NOT ScootsDB.EOF Then Shipcost1 = Shipcost1 + ScootsDB(CARTSCC) 'Response.Write Shipcost1 & ":" Else 'Response.Write "
Bad Session" End If ScootsDB.Close Set ScootsDB = Nothing End If End If Session("Weight") = Weight Else %> <% End If strSQL = "SELECT TotalQuant, TotalPrice FROM Cart WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) Tax = 0 If Session("SState") = "CA" Then Tax = formatnumber((CartsDB("TotalPrice") * 0.0775),2) Response.Write "" End If Session("SalesTax") = Tax 'Total Response.Write "" CartsDB.Close Set CartsDB = Nothing %>
Part Number Description Quantity   Price Total
" & PartID &"" & PartDesc &" $" & formatnumber(Price,2) & "$" & formatnumber(Price1,2) & "
  No products added yet!        
    CA Sales Tax:$" & Tax & "
    Total Price:$" & formatnumber((CartsDB("TotalPrice") + Tax),2) & "
Shipping Method
<% 'UPS Shipping Response.Write "" If Session("Weight") <> 0 Then Function getShipMethod(shipCode) getShipMethod = "Unknown" if shipCode = "01" then getShipMethod = "Next Day Air" if shipCode = "02" then getShipMethod = "2nd Day Air" if shipCode = "03" then getShipMethod = "Ground" if shipCode = "07" then getShipMethod = "Worldwide Express" if shipCode = "08" then getShipMethod = "Worldwide Expedited" if shipCode = "11" then getShipMethod = "Standard" if shipCode = "12" then getShipMethod = "3-Day Select" if shipCode = "13" then getShipMethod = "Next Day Air Saver" if shipCode = "14" then getShipMethod = "Next Day Air Early AM" if shipCode = "54" then getShipMethod = "Worldwide Express Plus" if shipCode = "59" then getShipMethod = "2nd Day Air AM" if shipCode = "65" then getShipMethod = "Express Saver" End Function Dim mydoc Set mydoc=Server.CreateObject("Microsoft.XMLDOM") mydoc.async=false Dim objXMLHTTP, xmlhttp Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP") upsurl = "https://www.ups.com/ups.app/xml/Rate" weight = Session("Weight") zip1 = "92845" zip2 = Session("SZip") country = "US" 'response.write "Weight: " & Weight & "
" 'response.write "Source Postal Code: " & zip1 & "
" 'response.write "Destionatinon Country Code: " & country & "
" 'response.write "Destination Postal Code: " & zip2 & "
" first = " checked" if cdbl(weight) <= 150 then upsxml = "9B9B1F8DC51DF902REG111111REG111111Rating and Service1.0001Rateshop01
" & zip1 upsxml = upsxml & "
" & zip2 & "" & country & "
11" upsxml = upsxml & "02PackageRate Shopping" & weight & "" 'upsxml = upsxml & "02PackageRate Shopping" & weight & "" upsxml = upsxml & "
" xmlhttp.Open "POST", upsurl, false xmlhttp.Send(upsxml) xmlresponse = xmlhttp.responseText mydoc.loadxml(xmlhttp.responseText) if mydoc.parseError.errorcode <> 0 then response.write "The xml document is not well-formed" else 'Response.write "Here is the rate information returned LIVE in REAL TIME from the UPS server:

" Set Root = mydoc.documentElement 'Check to make sure it was a success Set NodeList = Root.getElementsByTagName("ResponseStatusDescription") For Each Elem in NodeList result = Elem.firstChild.nodeValue 'response.write "The request was a " & result & "
" if result = "Failure" then Set NodeList = Root.getElementsByTagName("ErrorDescription") For Each ErrorText in NodeList 'response.write ErrorText.firstChild.nodeValue & "
Click here to fix your zipcode." next else 'Request was successfully processed, display the rates 'response.write "
" set nodes=mydoc.selectNodes("RatingServiceSelectionResponse/RatedShipment") for i = 0 to 0 'nodes.length - 1 set codes = nodes(i).selectNodes("Service/Code") Response.write "" set codes1 = nodes(i).selectNodes("TotalCharges/MonetaryValue") set ground = nodes(0).selectNodes("TotalCharges/MonetaryValue") ' If i=0 and realprice >= 25 and Weight < 50 then ' codes1(0).text = cCur(0) ' i = nodes.length ' ElseIf i=0 and realprice < 25 and Weight < 50 then ' codes1(0).text = cCur(8.00) ' i = nodes.length ' End If Response.write "" If first <> "" Then first = "" End If next shiptext1 = ground(0).text end if Next end if else 'Total shipment is over 150 lbs Dim weights(), requests(), responses(), rates(), grounds() numpackages = fix((weight - 1) / 150) redim weights(numpackages) redim requests(numpackages) redim responses(numpackages) redim rates(6) redim grounds(0) 'Response.write "
Total rates for " & fix((weight - 1) / 150) + 1 & " packages:

" for i = 0 to numpackages if i <> numpackages then weights(i) = 150 else weights(i) = (weight mod 150) if weights(i) = 0 then weights(i) = 150 end if requests(i) = "9B9B1F8DC51DF902REG111111REG111111Rating and Service1.0001Rateshop01
" & zip1 & "
" & zip2 & "" & country & "
1102PackageRate Shopping" & weights(i) & "
" xmlhttp.Open "POST", upsurl, false xmlhttp.Send(requests(i)) responses(i) = xmlhttp.responseText mydoc.loadxml(responses(i)) if mydoc.parseError.errorcode<>0 then response.write "The xml document is not well-formed" else Set Root = mydoc.documentElement 'Check to make sure it was a success Set NodeList = Root.getElementsByTagName("ResponseStatusDescription") For Each Elem in NodeList result = Elem.firstChild.nodeValue if result = "Failure" then Set NodeList = Root.getElementsByTagName("ErrorDescription") For Each ErrorText in NodeList 'response.write ErrorText.firstChild.nodeValue & "
Click here to fix your zipcode." next else 'Request was successfully processed, display the rates set nodes=mydoc.selectNodes("RatingServiceSelectionResponse/RatedShipment") for j = 0 to 0 'nodes.length - 1 set codes = nodes(j).selectNodes("Service/Code") if i = numpackages then Response.write "" end if set codes1 = nodes(j).selectNodes("TotalCharges/MonetaryValue") set ground = nodes(0).selectNodes("TotalCharges/MonetaryValue") grounds(0) = cdbl(rates(0)) + cdbl(ground(0).text) rates(j) = cdbl(rates(j)) + cdbl(codes1(0).text) if i = numpackages then Response.write "" If first <> "" Then first = "" End If end if next shiptext1 = rates(0) end if Next end if next end if Else Response.write "" Response.write "" End If Response.Write "
UPS " & getshipmethod(codes(0).text) & ":" ' If realprice >= 25 and Weight < 50 then ' Response.Write "FREE!" ' Else Response.Write "$" & formatnumber(codes1(0).text+cCur(Shipcost1)+cCur(Shipcost2),2) ' End If Response.Write "
UPS " & getshipmethod(codes(0).text) & ":$" & formatnumber(rates(j) + cCur(Shipcost1) + cCur(Shipcost2),2) & "
UPS Ground:$" & formatnumber(cCur(Shipcost1)+cCur(Shipcost2),2) & "
" 'End UPS Shipping %>
Shipping prices are estimated.
<% End If CartsConn.Close Set CartsConn = Nothing %> 
Call Us: 1-866-891-5513, Email Us: parts@sterlingequipmentco.com
All contents © copyright 2004 Laundry Cart Co., All rights reserved.