<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Response.Expires = -1500 %> <% Dim mylink IF Request("mylink") = "" THEN mylink = Request.ServerVariables("HTTP_REFERER") ELSE mylink = Request("mylink") END IF isdiscount = "no" IF Request.Cookies("BR") = "" THEN thissesh = "BR" + Session.SessionID extraunique = NOW myMnte = Minute(extraunique) IF Len(myMnte) <2 THEN myMnte = "0" & myMnte END IF mySecs = Second(extraunique) IF Len(mySecs) <2 THEN mySecs = "0" & mySecs END IF myDay = Day(extraunique) IF Len(myDay) <2 THEN myDay = "0" & myDay END IF extraunique = myDay & mySecs & myMnte thissesh = thissesh & extraunique Response.Cookies("BR")= thissesh Response.Cookies("BR").Expires = Date + 30 Response.Cookies("BR").Path = "/" Response.Cookies("BR").Secure = FALSE ELSE thissesh = Request.Cookies("BR") END IF %> Your <%=clientPs%> Shopping Basket at <%=clientNm%>
Christmas Trees and decorations for sale online from Stockeld Park Christmas Trees and decorations for sale online from Stockeld Park
Home About Us View Basket Check Out
Christmas Trees
Christmas Trees   Home > Your Basket
<% Set rsMenu = adoConn.Execute("SELECT ecat_id, ecat_name, ecat_pgn FROM eCats WHERE ecat_live = '1' ORDER BY ecat_do ASC") Do While NOT rsMenu.EOF %> <% rsMenu.MoveNext Loop rsMenu.Close Set rsMenu = Nothing %>
" class="NavlinkB"><%=Replace(rsMenu.Fields("ecat_name"),"''","'")%>
Popular Products
Special Offers
All Our Xmas Products
The Christmas Adventure
Other Stockeld Sites
Delivery
Contact Stockeld
Christmas Tree Tips
FAQs
Keep Informed
Customer Comments
 
 
Christmas Decorations
<% IF Request("msg") <> "" THEN Response.Write vbcrlf & "

" & Request("msg") & "

" END IF %> <% Sub bottombuttons %>



You must have session cookies enabled on your computer. Why?
     
<% End sub %> <% Dim sAction sAction = CStr(Request("action")) Select Case sAction %> <% Case "view" ' Get the shopping cart SET RS = adoConn.Execute("SELECT c_id, c_prodID, prod_pn, c_pp, prod_id, c_pq, c_colour, c_wt, prod_name, prod_pgn, prod_typ, prod_main, prod_delinc FROM Cart, Productz WHERE c_userID = '" & thissesh & "' AND c_prodID = prod_id AND c_proc = '0' ORDER BY prod_name ASC") %> <% count = 0 heavyitem = 0 thistot = 0 extracharge = 0 cartweight = 0 RS.MoveFirst Do While Not RS.EOF subtot = Cdbl(RS.Fields("c_pp")) * RS.Fields("c_pq") IF Cint(RS.Fields("prod_delinc")) = 1 THEN heavyitem = heavyitem + Cint(RS.Fields("c_pq")) ELSE cartweight = cartweight + (Cint(RS.Fields("c_wt")) * Cint(RS.Fields("c_pq"))) END IF %> <% thistot = thistot + subtot subtot = 0 count = count + 1 RS.MoveNext Loop %> <% 'Get default delivery charge SET rsDel = adoConn.Execute("SELECT * FROM Deliveryz WHERE d_default = '1'") isvat = Cint(rsDel.Fields("d_isvat")) 'calculate the default countries delivery charge IF cartweight <= 100 THEN delcharge = Cdbl(rsDel.Fields("d_p1")) END IF IF cartweight > 100 AND cartweight <= 250 THEN delcharge = Cdbl(rsDel.Fields("d_p2")) END IF IF cartweight > 250 AND cartweight <= 500 THEN delcharge = Cdbl(rsDel.Fields("d_p3")) END IF IF cartweight > 500 AND cartweight <= 750 THEN delcharge = Cdbl(rsDel.Fields("d_p4")) END IF IF cartweight > 750 AND cartweight <= 1000 THEN delcharge = Cdbl(rsDel.Fields("d_p5")) END IF IF cartweight > 1000 AND cartweight <= 1250 THEN delcharge = Cdbl(rsDel.Fields("d_p6")) END IF IF cartweight > 1250 AND cartweight <= 1500 THEN delcharge = Cdbl(rsDel.Fields("d_p7")) END IF IF cartweight > 1500 THEN delcharge = Cdbl(rsDel.Fields("d_p8")) END IF IF cartweight = 0 THEN delcharge = 0 END IF IF heavyitem > 0 THEN extracharge = heavyitem * Cdbl(rsDel.Fields("d_ptrees")) END IF delcharge = delcharge + extracharge rsDel.Close Set rsDel = Nothing %> <% IF vatsum <> 0 THEN %> <% END IF %>
Part Number: Product: Price Each: Quantity:
Subtotal:
<%= RS.Fields("prod_pn") %> <% Response.Write "" & Left(Replace(RS.Fields("prod_name"),"''","'"),60) & "" %> £<%= RS.Fields("c_pp") %>
"> " size="5">
£<%= FormatNumber(subtot) %>
  Goods Total:
<% Response.Write "£" & FormatNumber(thistot) & ""%>
  UK Delivery**
<% IF thistot = "" OR thistot = 0 THEN delcharge = 0 finaltot = thistot Response.Write "N/A" ELSE IF delcharge = "" OR delcharge = 0 OR delcharge = "0.00" THEN Response.Write "FREE" finaltot = thistot ELSE Response.Write "£" & FormatNumber(delcharge) & "" finaltot = thistot + delcharge END IF END IF IF isvat = 1 THEN 'vat calculations vatsum = (finaltot / 100) * 15 ELSE vatsum = 0 END IF finaltot = finaltot + vatsum %>
  VAT:*
£<%=FormatNumber(vatsum)%>
  Order Total:
<% Response.Write "£" & FormatNumber(finaltot) & ""%>
<% IF count <1 THEN response.write vbcrlf & "" response.write vbcrlf & "" & vbcrlf & "" & vbcrlf & "" & vbcrlf & "

Your basket is currently empty!

" END IF RS.Close Set RS = Nothing %> <% bottombuttons %>
 
<% Case "update" pid = Request("pid") IF Request("pq") = "" THEN pq = 0 Else pq = Request("pq") END IF 'check no negatives leftchar = Left(pq,1) IF leftchar = "-" THEN pqlength = Len(pq) -1 pq = Right(pq,pqlength) END IF ' check to see how many of this product are already in the cart (oldpq) Set rsCheckQuantity = adoConn.Execute("SELECT c_prodID, c_pq FROM Cart WHERE c_userID = '" & thissesh & "' AND c_prodID = '" & pid & "' AND c_proc = '0'") oldpq = rsCheckQuantity.Fields("c_pq") rsCheckQuantity.Close Set rsCheckQuantity = Nothing ' if they want less, update the cart and return the difference to stock. IF pq < oldpq THEN putback = oldpq - pq mysql = "UPDATE Productz SET prod_stock = prod_stock +" & putback & " WHERE prod_id = '" & pid & "'" adoConn.Execute(mysql) IF pq = 0 THEN mySQL = "DELETE FROM Cart WHERE c_prodID = '" & pid & "' AND c_userID = '" & thissesh & "' AND c_proc = '0'" ELSE mySQL = "UPDATE Cart SET c_pq = '" & pq & "' WHERE c_prodID = '" & pid & "' AND c_userID = '" & thissesh & "'" END IF adoConn.Execute(mySQL) adoConn.Close Set adoConn = Nothing Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink ELSE ' they want more, so we need to check that more is available. ' see what extra stock is available Set rsCheckQuantity = adoConn.Execute("SELECT prod_id, prod_stock FROM Productz WHERE prod_id = '" & pid & "'") inrealstock = rsCheckQuantity.Fields("prod_stock") rsCheckQuantity.Close Set rsCheckQuantity = Nothing totalstock = inrealstock + oldpq ' if they want more than is available. IF pq > totalstock THEN pq = totalstock msg = "Sorry, we only have " & totalstock & " available." cartsql = "UPDATE Cart SET c_pq = '" & pq & "' WHERE c_prodID = '" & pid & "' AND c_userID = '" & thissesh & "'" prodsql = "UPDATE Productz SET prod_stock = '0' WHERE prod_id = '" & pid & "'" END IF ' if they want less than the total available IF pq <= totalstock THEN takefromstock = pq - oldpq cartsql = "UPDATE Cart SET c_pq = '" & pq & "' WHERE c_prodID = '" & pid & "' AND c_userID = '" & thissesh & "'" prodsql = "UPDATE Productz SET prod_stock = prod_stock -" & takefromstock & " WHERE prod_id = '" & pid & "'" END IF adoConn.Execute(cartsql) adoConn.Execute(prodsql) adoConn.Close Set adoConn = Nothing IF msg <> "" THEN Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&msg=" & msg & "&mylink=" & mylink ELSE Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink END IF END IF %> <% Case "add" pid = Request("pid") pq = Request("pq") 'check no negatives leftchar = Left(pq,1) IF leftchar = "-" THEN pqlength = Len(pq) -1 pq = Right(pq,pqlength) END IF IF Request("pq") = "" OR Request("pq") = "0" THEN Response.Write "

You'll need to enter the quantity you require.

You can remove an item from your shopping basket by entering 0 on the View Basket page.

" ELSE sqlString = "SELECT prod_id, prod_price, prod_pn, prod_name, prod_stock, prod_wt, prod_iamatree FROM Productz WHERE prod_id = '" & pid & "'" SET RS2 = adoConn.Execute( sqlString ) pp = RS2.Fields("prod_price") ppn = RS2.Fields("prod_pn") pname = Replace(RS2.Fields("prod_name"),"'","") prodpq = RS2.Fields("prod_stock") prodwt = RS2.Fields("prod_wt") iamatree = RS2.Fields("prod_iamatree") IF pq > prodpq THEN pq = prodpq msg = "Sorry. We only have " & prodpq & " of " & pname & " in stock, plus any already in your basket." END IF IF pid <> "" AND pq <> "" THEN sqlString = "SELECT * FROM Cart WHERE c_userID= '" & thissesh & "' AND c_prodID ='" & pid & "' AND c_proc = '0'" SET RS = adoConn.Execute( sqlString ) IF RS.EOF THEN sqlString = "INSERT INTO Cart VALUES ('','" & pid & "','" & pp & "','" & pq & "','" & thissesh & "','" & ppn & "','" & pname & "', '" & pcol & "','0','" & prodwt & "','" & iamatree & "')" ELSE ' pq = pq + RS.Fields("c_pq") thisOne = RS.Fields("c_id") sqlString = "UPDATE Cart SET c_pq = c_pq + '" & pq & "' WHERE c_id = '" & thisOne & "'" END IF END IF RS.Close RS2.Close SET RS = Nothing SET RS2 = Nothing adoConn.Execute sqlString mySQL = "UPDATE Productz SET prod_stock = prod_stock -" & pq & " WHERE prod_id = '" & pid & "'" adoConn.Execute (mySQL) adoConn.Close Set adoConn = Nothing IF msg <> "" THEN Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink & "&msg=" & msg ELSE Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink END IF END IF %> <% Case "empty" Set rsPutBack = adoConn.Execute("SELECT c_pq, c_prodID FROM Cart WHERE c_userID = '" & thissesh & "' AND c_proc = '0'") Do While NOT rsPutBack.EOF mysql = "UPDATE Productz SET prod_stock = prod_stock +" & rsPutBack.Fields("c_pq") & " WHERE prod_id = '" & rsPutBack.Fields("c_prodID") & "'" adoConn.Execute(mysql) rsPutBack.MoveNext Loop rsPutBack.Close Set rsPutBack = Nothing mySQL = "DELETE FROM Cart WHERE c_userID = '" & thissesh & "' AND c_proc = '0'" adoConn.Execute(mySQL) adoConn.Close Set adoConn = Nothing Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink %> <% Case Else ' menu adoConn.Close Set adoConn = Nothing Response.Status = "302 Object moved" Response.Redirect "cart.asp?action=view&mylink=" & mylink %> <% End Select %>
Christmas decorations for sale online
Christmas decorations for sale online
 Christmas Trees & Christmas Decorations
© Stockeld Park 2006-2011
<% adoConn.Close Set adoConn = Nothing Set strCon = Nothing %>