<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% 'Define Constantes CONST cartpid = 0 CONST cartpname = 1 CONST cartpprice = 2 CONST cartpquantity = 3 'Pega Carrinho IF NOT isArray(Session("cart") ) THEN DIM localcart(4,20) ELSE localcart = Session("cart") END IF 'Pega Informações productid = TRIM(Request.QueryString("productId") ) productname = TRIM(Request.QueryString("product") ) productprice = TRIM(Request.QueryString("price") ) if productPrice = "" then productPrice = "0" end if 'Adicionar ao Carrinho IF productid <> "" THEN foundit= false FOR i=o to Ubound (localcart,2) IF localcart(cartpid,i) = productid THEN localcart(cartpquantity,i) = localcart( cartpquantity, i) + 1 foundit = TRUE EXIT FOR END IF NEXT IF NOT foundit THEN FOR i=0 to UBOUND(localcart,2) IF localcart(cartpid,i) = "" THEN localcart(cartpid,i) = productid localcart(cartpname,i) = productname localcart(cartpprice,i) = productprice localcart(cartpquantity,i) = 1 EXIT FOR END IF NEXT END IF END IF 'Atualiza Carrinho IF Request("updateQ") <> "" THEN FOR i=0 to Ubound (localcart,2) newQ = TRIM(Request("pq" & localcart(cartpid,i) ) ) deleteproduct = TRIM(Request.QueryString("productid") ) IF newQ = "" or newQ = "0" or deleteproduct <> "" THEN IF deleteproduct = localcart(cartpid,i) THEN localcart(cartpid,i) = "" END IF ELSE IF isNumeric(newQ) THEN localcart (cartpquantity,i) = newQ END IF END IF NEXT END IF 'Update Sesssion Carrinho Session("cart") = localcart 'product = request.QueryString("product") 'session("product") = product 'productId = request.QueryString("contentId") 'session("productId") = productId %>
<% Set objFileSys = Server.CreateObject("scripting.FileSystemObject") Set Thefolder = objFileSys.GetFolder(strCaminho_titleimg) Set Thefiles = TheFolder.files For Each Thefiles in TheFiles if TheFiles.Name = "title"&strTipContent&".gif" then TipContent = TheFiles.Name exit for end if next Set objFileSys = nothing Set Thefolder = nothing Set Thefiles = nothing %> <% 'Set objFileSys = Server.CreateObject("scripting.FileSystemObject") 'Set Thefolder = objFileSys.GetFolder(strCaminho_icoImg) 'Set Thefiles = TheFolder.files 'For Each Thefiles in TheFiles 'if TheFiles.Name = strTipContent&".jpg" then 'TipContent = TheFiles.Name 'exit for 'end if 'next 'Set objFileSys = nothing 'Set Thefolder = nothing 'Set Thefiles = nothing %>
<%if isEmpty(TipContent) then%><%else%><%end if%>
<% total = 0 %> <% FOR i=0 TO Ubound(localcart,2) %> <% IF localcart(cartpid,i) <> "" THEN %> <%' total = total + localcart(cartpprice,i)*localcart(cartpquantity,i)%> <% END IF %> <% NEXT %>
Produtos Preço Quantidade
<%=localcart(cartpname,i)%> <%'=localcart(cartpprice,i)%> Remover
Total: R$<%=Total%>


<< Orçar Mais Produtos | Finalizar Orçamento >>