<%@ LANGUAGE = "VBScript" %> <% 'Check if cart is empty If IsArray(Session("cart")) = false Then Dim acart(19,1) Session("cart") = acart else acart=session("cart") end if cempty=true for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then cempty=false end if next %> <%= storename %> <% header categorymenu %>

<% 'add to shopping bag 'create cart If cempty Then %>

empty cart

· hey! your cart is empty!


<% else %>

contents of shopping cart
· Change your order by clicking on the item name below.
· Delete an item by clicking the "delete item" button to the left of it.
· Continue shopping by selecting a department above.
<% 'Display contents of shopping cart acart=session("cart") subtotal=0 for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then set rscart=db.execute("select name,productid,price,saleprice from products where productid=" & acart(i,0)) if rscart("saleprice")="" or rscart("saleprice")=0 then currentprice=rscart("price") else currentprice=rscart("saleprice") end if %> <% subtotal=subtotal+(currentprice * acart(i,1)) end if next tax=subtotal*taxrate/100 %>
Delete  Item  Quantity  Price Each  Total 
"><%= rscart("name") %>
<%= acart(i,1) %> <%= cursymbol & formatnumber(currentprice)%> <%= cursymbol & formatnumber(currentprice * acart(i,1)) %>

Grand Total: <%= cursymbol & formatnumber(subtotal+tax) %>

<% end if %>
<% footer %> <% db.close set db=nothing %>