%
Sub HtmlProductFormatRow
'**********************************************************************************
' A template tmp_productformat.htm is supplied. It is used to format
' products. Special keywords in the form
' [ formatimage sub]
' [Formatproductoptions sub]
' [formatquantity sub]
' [formathyperlinks sub]
' formatoverallrating sub]
' VP-ASP 6.50
' July 11, 2003 Fix template vulnerability
' Aug 19, 2003 fix template paging
' Sept 25, 2005 fix inventoryproducts
' July 3, 2005 Inventory products
'**************************************************************
' objrs is already opened pointing to record
dim template, rc, url, stayonpage
StartColumnOrRow
template=GetProductTemplate
If Template="" then
Serror=getlang("LangExdNoTemplate")
shoperror serror
end if
If ProductSelect<>"Yes" then
'VP-ASP 6.09 - added xmysite call
response.write "
tag removed from line below
response.write ""
end if
response.write ""
end if
EndColumnOrRow
end sub
'
Sub HtmlProductFormatHeader
'*************************************
' Headers for product are displayed here
' VP-ASP 4.00
' June 2, 2002
'**************************************
Response.write Prodtable
colcount=0
end sub
Sub StartColumnorRow
'debugwrite "colcount=" & colcount & "maxcolumns=" & productmaxcolumns
If ProductMaxColumns=1 or colcount=0 then
Response.write prodrow
end if
response.write "
"
end sub
Sub EndColumnorRow
If ProductMaxColumns=1 then
response.write "
"
Response.write ""
exit sub
end if
Response.write ""
end sub
Sub Handle_Product (isub)
select case isub
Case "FORMATIMAGE"
Formatimage
Case "FORMATBUTTON"
If ProductSelect="Yes" then
AddSelect
else
Formatbutton
end if
Case "FORMATHYPERLINKS"
Formathyperlinks
Case "FORMATOVERALLRATING"
Formatoverallrating
Case "FORMATPRODUCTOPTIONS"
Formatinventoryproducts dbc,objrs
Formatproductoptions
Case "FORMATQUANTITY"
Formatquantity
'VP-ASP 6.50 - product comparison
Case "FORMATCOMPARISON"
FormatComparison
case else
debugwrite "Unknown sub"
end select
end sub
'************************************************************************
' templates can be passed as request variables
' They can be dependent on the category being displayed
'*************************************************************************
Function GetProductTemplate
dim template, rtemplate, sql, rs, query
rtemplate=request("template")
if rtemplate="" then
rtemplate=getsess("Displaytemplate")
end if
'debugwrite "template=" & rtemplate
If rtemplate<>"" then
dim suffix
suffix=right(rtemplate,3)
if lcase(suffix)="htm" then
template=rtemplate
Getproducttemplate=template
setsess "displaytemplate",rtemplate
exit function
end if
end if
'=========================
'VP-ASP 600 - insertion of template for shopdisplayproducts listing
'14/10/2005
'=========================
'1. Check if they have a template defined in the templatelisting field of the product record
query = "select templatelisting from products where catalogid = " & lngCatalogId
set rs = dbc.execute(query)
If not rs.EOF Then
if (rs("templatelisting") > "") and (not isnull(rs("templatelisting"))) then
template=rs("templatelisting")
' If getconfig("xcategoryproducttemplates")="No" then
Getproducttemplate=template
exit function
' end if
end if
end if
rs.close
set rs=nothing
'2. Check if the product is a parent product
'If it does, use the xproducttemplateinvent template (if specified)
'Otherwise use the xproducttemplate template
query = "select hassubproduct from products where catalogid = " & lngCatalogId
set rs = dbc.execute(query)
If not rs.EOF Then
if rs("hassubproduct") = "Yes" then
if getconfig("xproducttemplateinvent") > "" then
template=getconfig("xproductdisplaytemplateinvent")
else
template=getconfig("xproductdisplaytemplate")
end if
else
template=getconfig("xproductdisplaytemplate")
end if
else
template=getconfig("xproductdisplaytemplate")
end if
rs.close
set rs=nothing
'=========================
If getconfig("xcategoryproducttemplates")="No" then
Getproducttemplate=template
exit function
end if
' because we are really part of shopdisplayproducts we can use open connect and cat_id
If cat_id<>"" then
query = "select * from categories where categoryid = " & cat_id
set rs = dbc.execute(query)
If not rs.EOF Then
rtemplate = rs("catproducttemplate")
if isnull(rtemplate) then
rtemplate=template
end if
template=rtemplate
end if
rs.close
set rs=nothing
End if
Getproducttemplate=template
end function
%>