% 'This file is part of ProductCart, an ecommerce application developed and sold by Early Impact LLC. ProductCart, its source code, the ProductCart name and logo are property of Early Impact, LLC. Copyright 2001-2003. All rights reserved. You are not allowed to use, alter, distribute and/or resell any parts of ProductCart's source code without the written consent of Early Impact. To contact Early Impact, please visit www.earlyimpact.com. %> <% response.Buffer=true %> <% ' Check if the store is on. If store is turned off display store message If scStoreOff="1" then response.redirect "msg.asp?message=83" End If '<--RP--> If RewardsActive=True then If (Request("refby") <> "") And (RewardsReferral=True) Then Session("referral")=CLng(Request("refby")) End If End if '<--RP--> '---> start store session if not aleady initiated <---- if session("idcustomer")="" then session("idPCStore")= scID session("idCustomer")=CLng(0) session("idAffiliate")=CLng(1) session("language")=Cstr("english") session("pcCartIndex")=CLng(0) dim pcCartArray(100,35) session("pcCartSession")=pcCartArray end if if session("idPCStore")<>"" AND session("idPCStore")<>scID then session.Abandon() session("idPCStore")= scID session("idCustomer")=CLng(0) session("idAffiliate")=CLng(1) session("language")=Cstr("english") session("pcCartIndex")=CLng(0) redim pcCartArray(100,35) session("pcCartSession")=pcCartArray end if ' Check to see if the user is updating the product after adding it to the shopping cart tIndex=0 tUpdPrd=request.QueryString("imode") if tUpdPrd="updOrd" then tIndex=request.QueryString("index") end if ' Check to see if the user was referred by an Affiliate web site if request.querystring("idAffiliate")<>"" and isNumeric(request.querystring("idAffiliate"))then session("idAffiliate")= request.querystring("idAffiliate") end if dim query, conntemp, rs, pIdProduct, pDescription, pPrice, pDetails, pListPrice, pLgimageURL, pImageUrl, pWeight, pSku ,pconfigOnly,pserviceSpec, pBtoBPrice, plistHidden, pArequired,pBrequired, pStock, pEmailText, pformQuantity, pnoshipping, pcustom1, pcustom2, pcustom3, pcontent1, pcontent2, pcontent3, pxfield1, pxfield2, pxfield3, px1req, px2req, px3req, pNoStock, psDesc, pnoshippingtext pIdProduct=request.QueryString("idProduct") if trim(pIdProduct)="" or IsNumeric(pIdProduct)=false then response.redirect "msg.asp?message=85" end if '--> open database connection call opendb() ' --> increase visits for product <-- query="UPDATE products SET visits=visits+1 WHERE idProduct="& pIdProduct set rs=server.CreateObject("ADODB.RecordSet") set rs=conntemp.execute(query) if err.number <> 0 then set rs=nothing call closeDb() response.redirect "techErr.asp?error="&Server.Urlencode("Error in viewPrd.asp - Line 76") end if ' --> check for discount per quantity query="SELECT idDiscountperquantity FROM discountsperquantity WHERE idproduct=" &pidProduct set rs=server.CreateObject("ADODB.RecordSet") set rs=conntemp.execute(query) if err.number <> 0 then set rs=nothing call closeDb() response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewPrd.asp - Line 87") end if dim pDiscountPerQuantity if not rs.eof then pDiscountPerQuantity=-1 else pDiscountPerQuantity=0 end if set rs=nothing ' --> gets product details from db query="SELECT iRewardPoints, description, sku, configOnly, serviceSpec, price, btobprice, details, listprice, listHidden, imageurl, largeImageURL, Arequired, Brequired, stock, weight, emailText, formQuantity, noshipping, custom1, content1, custom2, content2, custom3, content3, xfield1, x1req, xfield2, x2req, xfield3, x3req, noprices, IDBrand, sDesc, noStock, noshippingtext,pcprod_HideBTOPrice,pcprod_QtyValidate,pcprod_MinimumQty,pcprod_HideDefConfig, notax FROM products WHERE idProduct=" &pidProduct& " AND active=-1" set rs=server.CreateObject("ADODB.RecordSet") set rs=conntemp.execute(query) if err.number <> 0 then set rs=nothing call closeDb() response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewPrd.asp - Line 106") end if if rs.eof then set rs=nothing call closeDb() response.redirect "msg.asp?message=88" end if ' --> set product variables <--- iRewardPoints=rs("iRewardPoints") pDescription=replace(rs("description"),""",chr(34)) pSku= rs("sku") pconfigOnly=rs("configOnly") pserviceSpec=rs("serviceSpec") pPrice=rs("price") pBtoBPrice=rs("bToBPrice") pDetails=replace(rs("details"),""",chr(34)) pListPrice=rs("listPrice") plistHidden=rs("listHidden") pimageUrl=rs("imageUrl") pLgimageURL=rs("largeImageURL") pArequired=rs("Arequired") pBrequired=rs("Brequired") pStock=rs("stock") pWeight=rs("weight") pEmailText=rs("emailText") pFormQuantity=rs("formQuantity") pnoshipping=rs("noshipping") pcustom1=rs("custom1") pcontent1=rs("content1") pcustom2=rs("custom2") pcontent2=rs("content2") pcustom3=rs("custom3") pcontent3=rs("content3") pxfield1=rs("xfield1") px1req=rs("x1req") pxfield2=rs("xfield2") px2req=rs("x2req") pxfield3=rs("xfield3") px3req=rs("x3req") pnoprices=rs("noprices") if isNull(pnoprices) OR pnoprices="" then pnoprices=0 end if pIDBrand=rs("IDBrand") psDesc=rs("sDesc") pNoStock=rs("noStock") pnoshippingtext=rs("noshippingtext") pcv_intHideBTOPrice=rs("pcprod_HideBTOPrice") if isNull(pcv_intHideBTOPrice) OR pcv_intHideBTOPrice="" then pcv_intHideBTOPrice="0" end if pcv_intQtyValidate=rs("pcprod_QtyValidate") if isNull( pcv_intQtyValidate) OR pcv_intQtyValidate="" then pcv_intQtyValidate="0" end if pcv_lngMinimumQty=rs("pcprod_MinimumQty") if isNull(pcv_lngMinimumQty) OR pcv_lngMinimumQty="" then pcv_lngMinimumQty="0" end if intpHideDefConfig=rs("pcprod_HideDefConfig") if isNull(intpHideDefConfig) OR intpHideDefConfig="" then intpHideDefConfig="0" end if pnotax=rs("notax") set rs=nothing ' Check to see if the product has been assigned to a brand. If so, get the brand name if (pIDBrand&""<>"") and (pIDBrand&""<>"0") then query="select BrandName from Brands where IDBrand=" & pIDBrand set rs=server.CreateObject("ADODB.RecordSet") set rs=conntemp.execute(query) if not rs.eof then BrandName=rs("BrandName") end if set rs=nothing end if %> <% ' Check to see if this is a BTO product. If so, get additional product information if pserviceSpec<>0 then query="SELECT categories.categoryDesc, products.description, configSpec_products.configProductCategory, configSpec_products.price, categories_products.idCategory, categories_products.idProduct, products.weight FROM categories, products, categories_products INNER JOIN configSpec_products ON categories_products.idCategory=configSpec_products.configProductCategory WHERE (((configSpec_products.specProduct)="&pIdProduct&") AND ((configSpec_products.configProduct)=[categories_products].[idproduct]) AND ((categories_products.idCategory)=[categories].[idcategory]) AND ((categories_products.idProduct)=[products].[idproduct]) AND ((configSpec_products.cdefault)<>0)) ORDER BY configSpec_products.catSort, categories.idCategory, configSpec_products.prdSort;" set rs=server.CreateObject("ADODB.RecordSet") set rs=conntemp.execute(query) if err.number <> 0 then set rs=nothing call closedb() response.redirect "techErr.asp?error="& Server.Urlencode("Error in viewPrd.asp - Line 281") end if query="SELECT * FROM configSpec_Charges WHERE specProduct="&pIdProduct set rstemp=server.CreateObject("ADODB.RecordSet") set rstemp=conntemp.execute(query) BTOCharges=0 if not rstemp.eof then BTOCharges=1 end if set rstemp=nothing 'if this BTO product has been configured by the administrator, use this form action and JavaScript validation functions if NOT rs.eof then response.write "
<%' Product reviews feature - new in ProductCart v2.75 %>