function additem(id, qty)
set cartobj = new cartkit
varcartstatus = cartobj.checkcart
if varcartstatus=false then
cartobj.createcart
mudcart=session("cart")
mudcart(0,0)=id
mudcart(0,1)=qty
session("cart")=mudcart
exit function
elseif varcartstatus=true then
if cartobj.checkitem(id) = true then
cartobj.updateitem id,qty
elseif cartobj.checkitem(id) = false then
mudcart = session("cart")
for i = lbound(mudcart) to ubound(mudcart)
if mudcart(i,0) = "" then
mudcart(i,0) = id
mudcart(i,1) = qty
session("cart") = mudcart
exit function
end if
next
end if
end if
end function
updateitem设计:
function updateitem(id, qty)
mudcart = session("cart")
for i = lbound(mudcart) to ubound(mudcart)
if mudcart(i,0) = id then
mudcart(i,1) = qty
session("cart")=mudcart
exit function
end if
next
end function
viewitem设计:
function viewitem()
mudcart=session("cart")
if isarray(mudcart) then
%>