%@ LANGUAGE="VBSCRIPT" %>
<% PageStrings = "18, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 70, 71, 121, 164, 222" %>
<%
thispage="basket"
%>
<%
aryCart2 = aryCart
Function AddToExistingItem(V,Q,aryCart2)
For comp = 0 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity")
If aryCart2(comp,1) = V then
aryCart2(comp,2) = aryCart2(comp,2) + Q
duplicate = 1
end if
next
AddToExistingItem = aryCart2
End Function
Function AddNewItemLine(V,Q,aryCart2)
aryCart2(iCount,1) = V
aryCart2(iCount,2) = Q
iCount=iCount+1
AddNewItemLine = aryCart2
End Function
Function TagRowForDeletion(R,aryCart2)
For comp = 0 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity")
If aryCart2(comp,1) = R then
aryCart2(comp,1) = ""
aryCart2(comp,2) = ""
iCount = iCount - 1
end if
next
TagRowForDeletion = aryCart2
End Function
Function SquashOutSpaces(aryCart2)
For comp = 0 to (Application(HASHKEYNUMBERXYZ & "basketmaxcapacity")-1)
If aryCart2(comp,2) = "" then
aryCart2(comp,1) = aryCart2(comp + 1,1)
aryCart2(comp,2) = aryCart2(comp + 1,2)
aryCart2(comp + 1,1) = ""
aryCart2(comp + 1,2) = ""
end if
next
SquashOutSpaces = aryCart2
End Function
duplicate = 0
R = Request.QueryString("R")
V = Request.QueryString("V")
Q = Request.Querystring("Q")
strReturnURL = replace(replace(Request.QueryString("U"),"questionmark","?"),"ampersand","&")
strSpeedMessage = Request.Querystring("strSpeedMessage")
numLineCount = Request.Querystring("numLineCount")
if Q="" then Q=1
Q=Q*1
product = Request.QueryString("product")
If Request.Form("V")<>"" then
V = Request.Form("V")
end if
If request.querystring("FF") = "yes" then
V = "refresh"
for tt = 1 to iCount
aryCart2(tt-1,2) = (Request.querystring("T" & tt))
if Not IsNumeric(aryCart2(tt-1,2)) then
aryCart2(tt-1,2) = ""
iCount = iCount - 1
end if
if aryCart2(tt-1,2) = "0" then
aryCart2(tt-1,2) = ""
iCount = iCount - 1
end if
If IsNumeric(aryCart2(tt-1,2)) then
aryCart2(tt-1,2) = Int(aryCart2(tt-1,2))
If aryCart2(tt-1,2) < 0 then
aryCart2(tt-1,2) = ""
iCount = iCount - 1
end if
end if
next
end if
If V <> "refresh" and V <> "remove" then
If strReturnURL<>"" then
strReturnURL = strReturnURL & "&strShowBackLink=n"
For SpeedRows = 1 to numLineCount
tempV = Request.querystring("V" & SpeedRows)
tempQ = Request.querystring("Q" & SpeedRows)*1
If tempV<>"" then
aryCart2 = AddToExistingItem(tempV,tempQ,aryCart2)
If duplicate = 0 then
aryCart2 = AddNewItemLine(tempV,tempQ,aryCart2)
end if
end if
duplicate = 0
Next
else
aryCart2 = AddToExistingItem(V,Q,aryCart2)
If duplicate = 0 then
aryCart2 = AddNewItemLine(V,Q,aryCart2)
end if
end if
end if
If V = "remove" then
aryCart2 = TagRowForDeletion(R,aryCart2)
end if
For y = 1 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity")
aryCart2 = SquashOutSpaces(aryCart2)
next
%>
<%
If len(Request.Querystring("Empty")) > 0 then response.redirect("empty_bask.asp")
If len(Request.Querystring("Checkout")) > 0 then response.redirect("shipto.asp")
If len(Request.Querystring("Enquire")) > 0 then response.redirect("shipto.asp?m=enquiry")
%>
<%
If quantitiesadjusted="yes" then strReturnURL=""
If Application(HASHKEYNUMBERXYZ & "showbasket") = "n" AND strReturnURL<>"" then response.redirect(strReturnURL)
Call ReadFromTemplate(templatelocation,aryPageTemplate,strBasketHTML,strCategoryListHTML)
If IsNumeric(Application(HASHKEYNUMBERXYZ & "showbasket")) AND strReturnURL<>"" then strMetaRefresh=""
If strSpeedMessage<>"" then strMetaRefresh=""
aryPageTemplate(0) = Replace(aryPageTemplate(0),"
","" & vbcrlf & strMetaRefresh)
response.write(aryPageTemplate(0))
%>
| <% WriteString("PageTitle_ShoppingBasket") %> |
<%
If strMetaRefresh<>"" then %>
<% WriteString("ContentText_ItemsAdded") %>
|
| <% WriteString("ContentText_PleaseWait") %> |
<% else
If iCount = 0 then %>
<% if V="speedorder" AND strSpeedMessage<>"" then %>
| <% =strSpeedMessage %> |
<% end if %>
| <% WriteString("ContentText_BasketEmpty") %> |
<% else %>
<% end if %>
<%
end if
response.write(aryPageTemplate(1))
DataConn.Close
set DataConn = nothing
%>