%
'************************************************************************************
'* *
'* MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH *
'* ONEWORLDSTOREFRONT IS DONE AT YOUR OWN RISK! *
'* Product : OneWorldStoreFront *
'* Copyright: Copyright (C) 2004 OneWorldStoreFront.Com *
'* Registration Number: 1024507 *
'* http://strategis.ic.gc.ca/ *
'* *
'************************************************************************************
Dim idCategory, sIDProduct, sDescription, sPrice, sSmallImageURL, sStock, sBToBPrice, sVisits
'************************************************************************************
'* *
'* *
'* *
'************************************************************************************
Sub ActionSubroutine()
If ( iOWRowsShown = "" ) Or ( NOT IsNumeric(iOWRowsShown) ) Then
iOWRowsShown = 5
End If
' display the collage html
Response.Write LANG_DT( "HOMEPAGE_COLLAGE", "" )
' define the array to store products (2 columns)
Randomize()
iRandomNumber = Int (1000*Rnd)+1
sSQLText = "SELECT TOP " & iOWRowsShown & " idProduct, description, details, price, smallImageURL, stock, bToBPrice, visits, Rnd(" & -1*iRandomNumber & "*idProduct) AS RandCol FROM Products WHERE showInHome=-1 AND active=-1 AND Stock > 0 ORDER BY 9"
Call DB_getFromDatabase(sSQLText, rsStoreData, "")
If ( NOT rsStoreData.EOF ) Then
Response.Write "
<%
While ( NOT rsStoreData.EOF )
sSmallImageURL = rsStoreData("smallImageURL")
sDescription = rsStoreData("description")
sPrice = rsStoreData("price")
sBToBPrice = rsStoreData("bToBprice")
sStock = rsStoreData("stock")
sIDProduct = rsStoreData("IDProduct")
%>
<%
If ( Trim(sSmallImageURL) <> "" ) Then
%>
 |
 |
 |
 |
<%If ( bOWAdvancedImages ) Then%>
<%Else%>
<%End If%>
|
 |
 |
 |
 |
<%
Else
%>
&idCategory=<%=idCategory%>"> " border=0>
<%
End If
%>
|
<%
sBrand = ACCNT_ReturnADV("OW_CUSTCOMPANY", "V", rsStoreData("idSupplier"), C_OVERRIDE_ADV)
If ( sBrand <> "" ) Then
sBrand = sBrand & " "
End If
%>
<%=sBrand%>
<%=sDescription%>
<%
If ( ACCNT_InGroup(iLoginAccountUnq, C_GROUP_DEALER) ) Then
sOW_DEALERLEVEL = ACCNT_ReturnADV("OW_DEALERLEVEL", "V", iLoginAccountUnq, C_OVERRIDE_ADV)
If ( sOW_DEALERLEVEL <> "" ) Then
sSQLText = "SELECT Price FROM DealerProdRef (NOLOCK) WHERE DealerLevelsUnq = " & sOW_DEALERLEVEL & " AND idProduct = " & sIDProduct
Call DB_getFromDatabase(sSQLText, rsStoreData2, "")
If ( NOT rsStoreData2.EOF ) Then
%>
<%=LANG_DT( "DEFAULT_DEALERPRICE", "Dealer Price" )%>: <%=CONVERSION_Currency(rsStoreData2("Price"))%>
<%
Else
' this product doesn't have a dealer price at this level, so fall back to retail price
%>
<%=LANG_DT( "DEFAULT_OURPRICE", "Our Price" )%>: <%=CONVERSION_Currency(sPrice)%>
<%
End If
Call DB_closeRecordset(rsStoreData2)
Else
' this dealer hasn't been assigned a dealer level, so fall back to retail price
%>
<%=LANG_DT( "DEFAULT_OURPRICE", "Our Price" )%>: <%=CONVERSION_Currency(sPrice)%>
<%
End If
Else
if sBtoBPrice>0 and (bOWShowBtoBPrice or ACCNT_InGroup(iLoginAccountUnq, C_GROUP_WHOLESALE)) then
Response.Write LANG_DT( "DEFAULT_OURPRICE", "Our Price" ) & ": " & CONVERSION_Currency(sBToBPrice)
Else
Response.Write LANG_DT( "DEFAULT_OURPRICE", "Our Price" ) & ": " & CONVERSION_Currency(sPrice)
End If
End If
%>
<%If ( sStock > 0 ) Then%>
<%=LANG_DT( "DEFAULT_ADDTOCART", "Add To Cart!" )%>
<%End If%>
|
<%
rsStoreData.MoveNext
Wend
%>
<%
End If
Call DB_closeRecordset(rsStoreData)
Set rsStoreData = Nothing
End Sub
'************************************************************************************
'************************************************************************************
'* *
'* *
'* *
'************************************************************************************
sub singleProd(rsStoreData)
' get the category this product is in so we can display links to "Buy now" and to view it's details
sSQLText = "SELECT c.idCategory FROM categories c, CatProdMap cp, products p WHERE p.idProduct=cp.idProduct AND cp.idCategory=c.idCategory AND p.idProduct = " & sIDProduct
Call DB_getFromDatabase(sSQLText, rsStoreData2,"")
If ( NOT rsStoreData2.EOF ) Then
idCategory = rsStoreData2("idCategory")
Else
idCategory = 1
End If
Call DB_closeRecordset(rsStoreData2)
%>