%@ Language=VBScript %> <%Option Explicit%> <% Dim PageName PageName = "My Free Quote" %> <% Response.Expires = 0 If Request.Cookies("SessionID") = "" Then Response.Cookies("SessionID") = Session.SessionID SessionID = Request.Cookies("SessionID") 'If SessionID = "" Then Response.Redirect "no_cookies.asp" Conn.open strConn Dim Category, SubCategory, PageCategory Dim Quantity, NewQuantity, Colours, NewColours, ProductID, SessionID, Options, NewOptions Dim Email, Title, FirstName, LastName, Street, Suburb, State, Postcode Dim Country, AreaCode1, Phone1, AreaCode2, Phone2, PostageAndHandling, InsuranceCharge, Comments, HowDidYouHear 'On Error Resume Next ProductID = Trim(Request("ProductID")) Options = Trim(Request("Options")) Quantity = Trim(Request("Quantity")) Colours = Trim(Request("Colours")) If IsNumeric(Quantity) Then If Clng(Quantity) > 1 Then Quantity = Clng(Quantity) Else Quantity = 1 End If Else Quantity = 1 End If ' Add Product to quote If ProductID <> "" Then strSQL = "SELECT CartID FROM Cart WHERE SessionID = " & SessionID & " AND ProductID = " & ProductID Set RS = Conn.Execute(strSQL) If RS.EOF Then strSQL = "INSERT INTO Cart (SessionID, ProductID, Options, Colours, Quantity) VALUES (" & SessionID & ", " & ProductID & ", " & FormatSQLText(Options) & ", " & FormatSQLNumber(Colours) & ", " & Quantity & ") " Else strSQL = "UPDATE Cart SET Quantity = Quantity + " & Quantity & ", Colours = " & FormatSQLNumber(Colours) & ", Options = Options & " & FormatSQLText(Options) & " WHERE CartID = " & RS("CartID" ) End If Set RS = Nothing Conn.Execute strSQL ' Empty Quote ElseIf Request("PageAction") = "Empty Quote" Then strSQL = "Delete From Cart Where SessionID = " & SessionID Conn.Execute strSQL ' Update Quote Quantities ElseIf Request("UpdateQuote") = "Update Quote" Or Request("QuoteRequest") = "Quote Request" Then Set RS = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = Conn RS.CursorType = adOpenDynamic RS.LockType = adLockOptimistic strSQL = "SELECT CartID, Quantity, Colours, Options FROM Cart WHERE SessionID=" & SessionID RS.Open strSQL While Not RS.EOF NewQuantity = Trim(Request("ProductQuantity" & RS("CartID"))) NewColours = Trim(Request("Colours" & RS("CartID"))) NewOptions = Trim(Request("Options" & RS("CartID"))) If NewQuantity = "" OR NewQuantity = "0" Then RS.Delete Else If IsNumeric(NewQuantity) Then RS("Quantity") = NewQuantity RS("Options") = NewOptions If NewColours = "" Then RS("Colours") = Null Else RS("Colours") = FormatSQLNumber(NewColours) End If End If End If RS.MoveNext WEnd Set RS = Nothing If Request("UpdateQuote") = "Update Quote" Then 'Redirect done to force page refresh and view correct quote. Set Conn = Nothing Response.Redirect "cart.asp" Response.end 'Else ' Response.Redirect "checkout.asp" End If End If 'Get user details if order made and failed strSQL = "SELECT TOP 1 * FROM Orders WHERE SessionID = " & SessionID & " " strSQL = strSQL & "Order By OrderID DESC" Set RS = Conn.Execute(strSQL) If Not RS.EOF Then Email = RS("Email") Title = RS("Title") FirstName = RS("FirstName") LastName =RS("LastName") Street = RS("Street") Suburb = RS("Suburb") State = RS("State") Postcode = RS("Postcode") Country = RS("Country") AreaCode1 = RS("AreaCode1") Phone1 = RS("Phone1") AreaCode2 = RS("AreaCode2") Phone2 = RS("Phone2") Comments = RS("Comments") HowDidYouHear = RS("HowDidYouHear") End If Set RS = Nothing %>
You do not have any products in your free quote. To add products to your free quote please select catalogue category from |