<%Option Explicit%> <% '******************************************************************* ' Version 5.00 Jan 3, 2003 ' called by shopdisplayproducts.asp when check box is used ' to select products to be ordered ' quantities are return as array, ' processed0, processed1 are checked ' products ' hidden field prodindex=couunt of possible products '********************************************************************* Dim Processed Dim Quantities Dim Productid Dim Quanarray dim QuanLimit Dim count Dim prodi Dim Rc Dim quantity Dim i, pi Dim addProduct dim productcount dim scartitem dim soptionvalue Dim indexp dim url, stayonpage scartitem = GetSess("CartCount") if scartitem="" then Response.Redirect "shopemptycart.asp" ' shoperror getlang("LangErrorCookies") end if addProduct="" Quantities=request("quantity") ProdIndex= Request("Prodindex") ' products in list count=cint(Prodindex) ' QuanArray=split(quantities,",",-1,1) Quanlimit=ubound(Quanarray) 'Debugwrite "count=" & count & "Proindex" & Prodindex & " quantities=" & quantities for prodi = 0 to count-1 Productid=Request("Processed" & prodi) if productid<>"" then productcount = GetSess("CartCount") If productcount = getconfig("xMaxCartitems") and ProductCount>0 then shoperror getlang("Langerror02") End If If quanlimit< 0 then quantity=1 else Quantity= quanArray(Prodi) end if ValidateQuantity quantity 'Debugwrite "adding" & productid & " Quantity=" & quanarray(prodi) & "prodi=" & prodi CartGetProduct productId, rc If rc= 0 then SetSess "newProductPrice","" GetProductFeatures prodi ' located in shopproductfeatures CartAddItem Productid, rc ' located in shopproductfeatures addProduct="TRUE" end if end if next ' Stay on page returns back to the last product display page If addproduct<>"" then stayonpage=getconfig("Xproductstayonpage") If stayonpage="Yes" then url=request("returnurl") if url<>"" Then response.redirect url end if end if Response.redirect "shopaddtocart.asp" ' display cart else shoperror getlang("LangSelectError01") end if %>