<%Option Explicit%> <% '********************************************************************************** ' Version 6.00 Automatic Extended Description ' shopexd.asp?id=xx ' xx = catalogid ' The template to be used is is xproducttemplate of a specific template for ' the product in the database ' July 4, 2004 Add dynamic header ' July 2, 2005 Inventory Products ' July 7, 2005 Also Bought ' August 9, 2005 add inventoryoutofstock '********************************************************************************* Dim CatalogId dim ccode Dim tmpRS Dim template dim dbc dim rc Dim InventoryCheck, InventoryPriceDisplay, inventoryoutofstock '------------------------------------------ ' VP-ASP 6.50.4 Bugs Fix - 08 October 2008 '------------------------------------------ if getconfig("xextendedpopup") <> "Yes" then setSess "CurrentURL","shopexd.asp" end if InitializeSystem Catalogid=request("id") if not isnumeric(catalogid) then catalogid="" end if '-------------------------------------- ' VP-ASP Security Patch - 17 April 2008 '-------------------------------------- ccode=cleanchars(request("ccode")) '-------------------------------------- If ccode<>"" then ccode=replace(ccode,"'","") end if if catalogId="" and ccode="" then catalogid=getsess("shopexdid") if catalogid="" then Serror=getlang("LangNoCatalogId") HandleError end if end if Setsess "shopexdid",catalogid ShopOpendatabaseP dbc WriteImpressions setupdynamicproduct dbc, catalogid ExdOpenRecordSet tmpRS GetTemplate If Template="" then Serror=getlang("LangExdNoTemplate") HandleError end if ' see if this product has sub products 'Inventorycheck=false ' no sub products 'InventoryPriceDisplay=true ' display prices with sub products 'InventoryProductYesNo dbc, tmpRS, catalogid, inventorycheck, Inventorypricedisplay, inventoryquantitydisplay, inventoryoutofstock ' ShopTemplateWrite template, tmpRS, rc tmpRS.close set tmpRS=nothing Shopclosedatabase dbc 'Finished Sub HandleError on error resume next tmpRS.close set tmpRS=nothing Shopclosedatabase dbc shoperror sError end sub ' Sub ExdOpenRecordSet (RS) If catalogid<>"" then Sql="select * from products where catalogid=" & catalogid else sql="select * from products where ccode='" & ccode & "'" end if Set rs=dbc.execute(sql) If rs.eof then Serror = SError & getlang("LangReadFail") & " " & catalogid HandleError end if end sub ' Sub GetTemplate on error resume next dim suffix Template="" '-------------------------------------- ' VP-ASP Security Patch - 17 April 2008 '-------------------------------------- template=cleanchars(request("template")) '-------------------------------------- if template<>"" then suffix=right(template,3) if lcase(suffix)="htm" then exit sub end if end if 'VP-ASP 6.09 - problem with incorrect template occasionally being used Template=getconfig("xProductTemplate") If isNull(tmpRS("template")) then If tmprs("hassubproduct") = "Yes" Then template=getconfig("xproducttemplateinvent") Else Template=getconfig("xProductTemplate") End if else template=tmprs("template") end If End sub Sub WriteImpressions if Catalogid <> "" then 'increment products impressions dbc.execute("UPDATE products SET impressions = impressions + 1 WHERE catalogid = " & catalogid) End If End Sub %>