<%
'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.
| Delete |
Item |
Quantity |
Price Each |
Total |
<%
'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
%>
 |
"><%= rscart("name") %>
|
<%= acart(i,1) %> |
<%= cursymbol & formatnumber(currentprice)%> |
<%= cursymbol & formatnumber(currentprice * acart(i,1)) %> |
<%
subtotal=subtotal+(currentprice * acart(i,1))
end if
next
tax=subtotal*taxrate/100
%>
|
|
Grand Total: |
<%= cursymbol & formatnumber(subtotal+tax) %> |
<% end if %>
|
<% footer %>
<%
db.close
set db=nothing
%>