<%@ Language=VBScript %><% '************************************************************ itemid=request("itemid") error=request("error") newaddqty=request.form("qty") task=request.form("task") if error="y" then errormessage="We encountered an error while trying to add this item to your cart, please try again.
" end if %> <% if itemid="" or itemid=NULL then pdredirect("features.asp") end if 'Open database get Item details. set rs=openrs("SELECT * FROM items WHERE active='Yes' AND id=" & itemid) if rs.EOF then pdredirect("features.asp") end if name=rs("name") imgresize=rs("imgresize") if imgresize="ON" then width="width=150" else width="" end if price=rs("price") saleprice=rs("saleprice") onsale=rs("onsale") 'Determine price to show. if onsale="Yes" then theprice=saleprice else theprice=price end if itemno=rs("itemno") hideprice=rs("hideprice") if hideprice="ON" then hideprice=1 else hideprice=0 end if hidehead=rs("hidehead") if hidehead="ON" then hidehead=1 else hidehead=0 end if if newaddqty="" then addqty=rs("addqty") if addqty>1 then else addqty=1 end if else addqty=newaddqty end if smallimage=rs("smallimage") 'If no picture. if smallimage="" or smallimage=NULL then smallimagefound="no" end if largeimage=rs("largeimage") 'If no picture. if largeimage="" or largeimage=NULL then imagefound="no" end if description=rs("description") 'Determine if item is out of stock. hidecobutt=0 if rs("qty")<=oosthresh then if showoos="ON" then showoos="YES" end if if stopoos="ON" then hidecobutt=1 end if end if pgvisitson=rs("pgvisitson") pgvisits=rs("pgvisits") shortdesc=rs("shortdesc") rs.close set rs=nothing if pgvisitson="1" then itemvisits=request.cookies("itemvisits") if instr(itemvisits,":" & itemid & ":")>0 then else Set rsmod = Server.CreateObject("ADODB.Recordset") on error resume next rsmod.Open "Select pgvisits From items WHERE id=" & itemid, DB, 1, 3 rsmod("pgvisits") = fixNum(pgvisits) + 1 rsmod.update rsmod.close on error goto 0 response.cookies("itemvisits")=itemvisits & ":" & itemid & ":" set rsmod=nothing end if end if 'check to see if item has options. 'Get category info on the item. set rs=openrs("SELECT id FROM optioncat WHERE itemid=" & itemid) if not rs.eof then hasoptions="yes" end if rs.close set rs=nothing 'Set Metatags for this item. Primary storefront keywords are used. title=name sitedesc=shortdesc if name="" or isnull(name) then else keywords=replace(name, " ", ", ") & ", " & keywords end if %>
<% 'Display all categories for this item. set rs2=openrs2("SELECT catlinks.id as linkid, catlinks.itemid, category.name, category.shortdesc, category.id as catid FROM catlinks INNER JOIN category on category.id=catlinks.catid WHERE itemid=" & itemid & " ORDER BY category.name") if not rs2.eof then rs2.movefirst while not rs2.eof catlinkid=rs2("linkid") catname=rs2("name") catdesc=rs2("shortdesc") catid=rs2("catid") %> <% rs2.movenext wend end if rs2.close set rs2=nothing %>
<% getHeading "", hdcat, "" %>
<%=showlevels(catid, shopurl & "shop/category.asp")%>
<% 'To display sub category, uncomment the line below. 'showsubcatsitem="Y" if showsubcatsitem="Y" then 'Open database get sub categories. set rs=openrs("SELECT * FROM category WHERE subof=" & catid & " ORDER BY name") if not rs.eof then %> <%=titheada%><% rs.movefirst while not rs.eof subcatname=rs("name") subcatid=rs("id") %> category.asp?catid=<%=subcatid%>"> <%=subcatname%> <% rs.movenext if not rs.eof then response.write (" | ") end if wend end if rs.close set rs=nothing end if %>
<%=catdesc%>
<% getleftcol(pg6) %>
<% if hideprice<>1 and hidecobutt<>1 then %> <% if hasoptions="yes" then %> <% end if%> showcart.asp" name="form"> <% set rs=openrs("SELECT * FROM optioncat WHERE itemid=" & itemid & " ORDER BY name") arraya=Array(catcount) arrayb=Array(optid) arrayc=Array(realoptprice) catcount=0 if not rs.eof then optpricetotal=0 rs.movefirst while not rs.eof catcount=catcount + 1 optcatname=rs("name") optcatid=rs("id") %> <% rs.movenext wend end if rs.close set rs=nothing %> <% if hasoptions="yes" then %> <% end if%> <% if hidecobutt=0 then %> <% end if %> <% end if %> <% if showoos="YES" then %> <% end if %>
<% getHeading "", hditem, "" %>
<%=fixERR(errormessage)%>
<% if hidehead<>1 then %> <% if imagefound<>"no" then %> align="right" vspace="8" hspace="8" alt="<%=name%>"> <%end if%><%=titheadb%>
<%=name%>
<%=titheadc%>
<%=itemno%>
<% if hideprice<>1 and hasoptions<>"yes" then %><%=titheadd%>
<% if onsale="Yes" then %> <% =showCurr(price)%>
<% end if response.write(showCurr(theprice)) %>
<% end if %>

<% end if %><%=description%>
<% getHeading titheadj, "", "" %>
<%=optcatname%>
<% getHeading "", titheadf, "" %>
<%=titheade%>
<% if onsale="Yes" then %> <% =showCurr(price)%>
<% end if response.write(showCurr(theprice)) %>
<%=titheadg%>
<%=showCurr((theprice + optpricetotal)*addqty)%>
<% if hasoptions="yes" then showbutton titbutta,"javascript:updateprice()","" end if %> <% showbutton titbuttb,"","form" %>  <%=titheadi%> 
<%=oosmess%>
 
<% getrightcol(pg6) %>