% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Display details for a specific product, including all ' : options. ' Product : Shopping Tree Store Frontend ' Version : 3.3 ' Modified : January 2005 ' Copyright: Copyright (C) 2004 Shopping Tree.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@ShoppingTree.com '************************************************************************* ' Date Description ' 10/23/05 Added user exit ' 11/20/05 Corrected problem with price display in getProdRelated(); ' '************************************************************************* Response.Buffer = true %> <% 'Product dim Description dim DescriptionLong dim Price dim Details dim relatedKeys dim listPrice dim smallImageURL dim imageURL dim Stock dim SKU dim fileName dim noShipCharge dim reviewAllow dim handlingFee dim a1 dim audioA1 dim a2 dim audioA2 dim b1 dim audioB1 dim b2 dim audioB2 dim weight 'Options dim priceToAdd dim percToAdd 'Work Fields dim testMode dim revCount dim revSum dim numMandatoryOpt dim optSize 'Database dim mySQL dim conntemp dim rstemp dim rstemp2 dim rsTemp3 dim cats 'Work dim idCust dim idOrder '************************************************************************* selectedLang = request.Form("language") if len(selectedLang) = 2 then session("language") = selectedLang response.cookies("language") = selectedLang response.Cookies("language").expires = dateAdd("d",30,now()) else selectedLang= Request.queryString("language") if len(selectedLang) = 2 then session("language") = selectedLang response.cookies("language") = selectedLang response.Cookies("language").expires = dateAdd("d",30,now()) end if end if 'Open Database Connection call openDb() 'Store Configuration if loadConfig() = false then call errorDB(LangText("ErrConfig",""),"") end if 'Get/Set Cart/Order Session idOrder = sessionCart() 'Get/Set Customer Session idCust = sessionCust() if not IsNumeric(idCust) then idCust = session.sessionID 'Get/Set Affilate ID call getIdAffiliate(Request.QueryString("idAff")) 'Check Product Code 'idProduct = trim(request("idProduct")&"") if not IsNumeric(idProduct) then 'Check SKU sku = trim(request("sku")&"") if len(sku) > 0 then mySQL = "SELECT idProduct " _ & "FROM products " _ & "WHERE sku = '" & validSQL(sku,"A") & "' " set rsTemp = openRSexecute(mySQL) if not rsTemp.EOF then idProduct = rsTemp("idProduct") else response.redirect siteRoot() & "/Scripts/sysMsg.asp?errMsg=this" & server.URLEncode(LangText("ErrInvProdID","")) end if call closeRS(rsTemp) else response.redirect siteRoot() & "/Scripts/sysMsg.asp?errMsg=that" & server.URLEncode(LangText("ErrInvProdID","")) end if end if 'Check if Product is being displayed as a Test if Instr(lCase(Request.ServerVariables("HTTP_REFERER")),"/sa_prod") = 0 then testMode = false else testMode = true end if 'Get Product Detail mySQL = "SELECT description,descriptionLong,relatedKeys,price," _ & " listprice,smallImageUrl,imageurl,stock,sku," _ & " fileName,noShipCharge,reviewAllow,details,weight,handlingFee," _ & " a1,audioA1,a2,audioA2,b1,audioB1,b2,audiob2 " _ & "FROM products " _ & "WHERE idProduct = " & validSQL(idProduct,"I") & " " if not testMode then mySQL = mySQL & "AND active = -1" end if set rsTemp = openRSexecute(mySQL) if rsTemp.eof then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode(LangText("ErrInvProdID","")) end if 'Assign product DB fields to local fields relatedKeys = trim(rsTemp("relatedKeys")&"") Price = rsTemp("price") listPrice = rsTemp("listPrice") smallImageURL = trim(rsTemp("SmallImageUrl")&"") imageURL = trim(rsTemp("imageUrl")&"") Stock = rsTemp("stock") sku = trim(rsTemp("sku")&"") fileName = trim(rsTemp("fileName")&"") noShipCharge = trim(rsTemp("noShipCharge")&"") reviewAllow = trim(rsTemp("reviewAllow")&"") handlingFee = rsTemp("handlingFee") weight = rsTemp("weight") a1 = rstemp("a1") audioA1 = rstemp("audioA1") a2 = rstemp("a2") audioA2 = rstemp("audioA2") b1 = rstemp("b1") audioB1 = rstemp("audioB1") b2 = rstemp("b2") audioB2 = rstemp("audioB2") 'Language for product descriptions Details = trim(langProduct(idProduct,"details",rsTemp("details"))) Description = trim(langProduct(idProduct,"description",rsTemp("description"))) DescriptionLong = trim(langProduct(idProduct,"DescriptionLong",rsTemp("DescriptionLong"))) closeRS(rsTemp) 'Build a category keyword string mySQL = "SELECT Categories_Products.idProduct, Categories.categoryDesc " _ & "FROM Categories_Products INNER JOIN Categories ON Categories_Products.idCategory = Categories.idCategory " _ & "WHERE (((Categories_Products.idProduct)= " & idProduct & "));" set rsTemp = openRSexecute(mySQL) do while not rsTemp.eof cats = cats & trim(rsTemp("categoryDesc")) & "," rsTemp.moveNext loop if len(cats) > 0 then cats = mid(cats,1,len(cats) - 1) closeRS(rsTemp) %> <% 'Close Database Connection call closeDb() '************************************************************************* 'Main Shopping Cart Display Area '************************************************************************* sub cartMain() ' Adjust for displayed currency listPrice = Exchange(listPrice) price = Exchange(price) response.write "
" & Request.QueryString("Msg") & "