<%@ LANGUAGE = "VBScript" %> <% productid=valid_sql(request.querystring("productid")) stage=request.form("stage") if productid=null or productid="" or not(isnumeric(productid)) then response.redirect("error.asp?msg=" & Server.URLEncode("We have no record of the product you are looking for.")) end if if stage="" or stage=null then else 'add to shopping bag 'create cart 'Session("cart")=null If IsArray(Session("cart")) = false Then Dim acart(19,1) acart(1,0)=productid acart(1,1)=request.form("qty") Session("cart") = acart else acart=session("cart") incart=false for i=lbound(acart) to ubound(acart) if acart(i,0)="" and acart(i,1)="" and not(incart) then acart(i,0)=productid acart(i,1)=request.form("qty") incart=true end if next session("cart")=acart end if end if 'get the relevant products details set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = " & productid) if rsprod.eof then response.redirect("error.asp?msg=" & Server.URLEncode("We have no record of the product you are looking for.")) end if 'get names and codes of all products in that category set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name") %> <%= storename %> <% header categorymenu %> <% if stage="" or stage=null then %> <% else %> <% end if %>
<%= rsprod("catname") %>
<% 'Display list of other products in category if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> "><%=rscatlist("name")%>
<% rscatlist.movenext wend end if %>
<% = rsprod("image") %> <%= rsprod("name") %>
Price: <% if rsprod("saleprice")="" or rsprod("saleprice")=0 then %> <% =cursymbol & formatnumber(rsprod("price")) %> <% else %> <% =cursymbol & formatnumber(rsprod("price")) %>
Sale Price: <% =cursymbol & formatnumber(rsprod("saleprice")) %> <% end if %>

How many of these do you want to order?
Quantity:

<%= rsprod("name") %>
Price: <% if rsprod("saleprice")="" or rsprod("saleprice")=0 then %> <% =cursymbol & formatnumber(rsprod("price")) %> <% else %> <% =cursymbol & formatnumber(rsprod("price")) %>
Sale Price: <% =cursymbol & formatnumber(rsprod("saleprice")) %> <% end if %>

<% if incart then %> <%= request.form("qty") %> of these items have been added to your shopping bag. To order more of this product click here.

To continue shopping select another item to the left or a new category above.

To complete your order click here to checkout. <% else %> This item has NOT been added to your cart. Your shopping cart is full

To view the items in your shopping cart click here.

To complete your order click here to checkout. <% end if %>
<% footer %> <% db.close set db=nothing %>