Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

(ASP)Code giỏ hàng pps
Nội dung xem thử
Mô tả chi tiết
(ASP)Code giỏ hàng
Dau tien la include cua shoppingcar : de shoppingcart su dung ma thuc hien cac cau lenh
File: include-shoppingcart:
<!--#include file="connections/config.asp"-->
<%
openconn
Public Sub themsp(pid)
strList=Session("ProductList")
countList=Session("ProductCount")
if (trim (pid)<>"") then
if (instr(strList,pid)=0) then'neu khong co ma san pham trong
list thi them
strList=strList+pid+","
Session("ProductList")=strList
CountList=CountList+"1"+","
Session("ProductCount")=CountList
else 'co san pham do trong gio hang roi
arrProducts=split(Session("ProductList"),",")
arrCounts=split(Session("ProductCount"),",")
For i = 0 to uBound(arrProducts)
if (inStr(arrProducts(i),pid))>0 and flag=false
then 'lam sao de refresh k bi tang
arrCounts(i)=CStr(Cint(arrCounts(i))+1)
flag=true
exit for
end if