%@LANGUAGE="VBSCRIPT"%> <% set Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_prophet_STRING Recordset2.Source = "SELECT id_products, pic_thumb FROM products" Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 3 Recordset2.Open() Recordset2_numRows = 0 %> <% ' 'Redirect if cart is empty ' if not isFound then response.redirect "baskempty_pt.htm" %> <% Function gen_key(digits) dim char_array(10) char_array(0) = "0" char_array(1) = "1" char_array(2) = "2" char_array(3) = "3" char_array(4) = "4" char_array(5) = "5" char_array(6) = "6" char_array(7) = "7" char_array(8) = "8" char_array(9) = "9" randomize do while len(output) < digits num = char_array(Int((9 - 0 + 1) * Rnd + 0)) output = output + num loop gen_key = output End Function %> <% sub if_exists idkey= gen_key(7) session ("idkey")= idkey end sub %> <% if session ("idkey") > " " then idkey = session ("idkey") else call if_exists end if %> <% if idkey < " " then call if_exists end if %> <% Dim Recordset1__MMColParam Recordset1__MMColParam = "1" if (Session("loc") <> "") then Recordset1__MMColParam = Session("loc") %> <% set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_prophet_STRING Recordset1.Source = "SELECT pprate FROM pp WHERE loc = '" + Replace(Recordset1__MMColParam, "'", "''") + "'" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 3 Recordset1.Open() Recordset1_numRows = 0 %> <% set Recordset3 = Server.CreateObject("ADODB.Recordset") Recordset3.ActiveConnection = MM_prophet_STRING Recordset3.Source = "SELECT vat FROM salestax" Recordset3.CursorType = 0 Recordset3.CursorLocation = 2 Recordset3.LockType = 3 Recordset3.Open() Recordset3_numRows = 0 %> <% CCcart_SalesTax= 0 %> <% dim addvat If (session("status")) < (" ") Then addvat = 0 else addvat = Recordset3("vat") end if %> <%if not Recordset3.eof then%> <% If (session("status")) < (" ") Then 'script_and_script%> <%If (Session("loc")) = ("uk") Then 'script%> <% CCcart_SalesTax=(CCcart_SubTotal + CCcart_Shipping - CCcart_Discount) * addvat %> <% End If ' end If (Session("loc")) = ("uk") script %> <% End If ' end If (session("status")) < (" ") script_and_script%> <%end if %> <%CCcart_Shipping = 3%> <% ' 'Update cart contents ' CC_UpdateAction=Request.ServerVariables("SCRIPT_NAME") if Request("CC_UpdateCart") <> "" then for i=0 to ubound(CCcart,2) intProductID=CCcart(CC_UniqueKey,i) Quantity=trim(Request.Form("Qty" & intProductID)) isDelete=trim(Request.Form("Delete" & intProductID)) if Quantity = "" or Quantity="0" or isDelete <> "" then CCcart(CC_PRODUCTID,i)="" else if IsNumeric(Quantity) then CCcart(CC_QUANTITY,i)=Quantity end if end if next ' 'Code below to prevent Object Moved error in Netscape ' CartToCookie CCcart,"CharonCart" if Session("UpdateNumber") <> "" then Session("UpdateNumber")=Session("UpdateNumber")+1 else Session("UpdateNumber")=1 end if response.redirect Request.ServerVariables("SCRIPT_NAME") & "?UpdateNumber=" & Session("UpdateNumber") end if %> <% ' 'Kill cart by setting cookie to nothing ' if Request("RemoveAll") <> "" then Response.Cookies("CharonCart")="" if "products_wp.asp" <> "" then Response.Redirect "products_wp.asp" end if %>