<%if pMetaDescription="" then%> <%else%> <%end if%> <%if pSearchKeywords="" then%> <%else%> <%end if%> <% dim mySQL, connTemp, rsTemp, pIdCategory, pCategoryDesc, totalPages, count, pIdAffiliate, pDefaultLanguage, pStoreFrontDemoMode, pCurrencySign, pDecimalSign, pCompany, pCompanyLogo, pAuctions, pListBestSellers, pNewsLetter, pPriceList, pStoreNews, pOneStepCheckout, pAffiliatesStoreFront, pCategoriesAlphOrder, pAllowNewCustomer, curPage, pHeaderKeywords, pLanguage, pCustomerName, pHeaderCartItems, pHeaderCartSubtotal, pMoneyDontRound, pIdParentCategory, pImageCategory, indexCategories, pIdCategory2, f, pIdProduct, pDescription, pSmallImageUrl, pStock, pDetails, pListPrice, pSpecialPrice, pIdCustomerType, pShowBtoBPrice, pCompareProducts, pUnderStockBehavior, pDimensions, pFType, pMyPrice '********************************** 'Added by murali '********************************** Dim pQuantityAndPrice(100) Dim pTempQuantity(100) Dim pTempPrice(100) Dim pSaving(100) '********************************** call saveCookie() on error resume next ' set affiliate pIdAffiliate=getUserInput(request.querystring("idAffiliate"),4) if isNumeric(pIdAffiliate)then session("idAffiliate")= pIdAffiliate end if ' get settings pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode") pCurrencySign = getSettingKey("pCurrencySign") pDecimalSign = getSettingKey("pDecimalSign") pCompany = getSettingKey("pCompany") pAuctions = getSettingKey("pAuctions") pSuppliersList = getSettingKey("pSuppliersList") pNewsLetter = getSettingKey("pNewsLetter") pAffiliatesStoreFront = getSettingKey("pAffiliatesStoreFront") pAllowNewCustomer = getSettingKey("pAllowNewCustomer") pRssFeedServer = getSettingKey("pRssFeedServer") pCategoriesAlphOrder = getSettingKey("pCategoriesAlphOrder") ' session pIdCustomer = getSessionVariable("idCustomer",0) pIdCustomerType = getSessionVariable("idCustomerType",1) ' defined 10 records per page const pNumPerPage = 10 if request.queryString("curPage") = "" then curPage = 1 else curPage = getUserInput(request.queryString("curPage"),4) end if pIdCategory = getUserInput(request.querystring("idCategory"),4) ' get category tree if pIdCategory<>"" then dim arrCategories(300,2) indexCategories = 0 pIdCategory2=pIdCategory ' load category array with all categories until parent do while pIdCategory2>1 mySQL="SELECT categoryDesc, idCategory, idParentcategory, imageCategory FROM categories WHERE idCategory=" & pIdCategory2 call getFromDatabase (mySql, rsTemp, "listCategoriesAndProducts") if rstemp.eof then response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(6,"Invalid ctg")) end if pImageCategory = rsTemp("imageCategory") pIdCategory2 = rsTemp("idParentCategory") arrCategories(indexCategories,0) = rsTemp("categoryDesc") arrCategories(indexCategories,1) = rsTemp("idCategory") indexCategories = indexCategories + 1 loop end if 'idParentCategory ' get child categories if pIdCategory="" then if pIdCategoryStart="" then ' get category start from stores mySQL="SELECT idCategoryStart FROM stores WHERE idStore=" &pIdStore call getFromDatabase (mySql, rsTempRoot, "getRootCategories") if not rsTempRoot.eof then pIdCategoryStart=rsTempRoot("idCategoryStart") else pIdCategoryStart=1 end if end if mySQL="SELECT idCategory, categoryDesc, idParentCategory, imageCategory FROM categories WHERE idParentCategory=" &pIdCategoryStart& " AND idCategory<>1 AND active=-1" else mySQL="SELECT idCategory, categoryDesc, idParentCategory, imageCategory FROM categories WHERE idParentCategory=" &pIdCategory& " AND idCategory<>1 AND active=-1" end if if pCategoriesAlphOrder="-1" then mySql=mySql&" ORDER BY categoryDesc" else mySql=mySql&" ORDER BY displayOrder" end if call getFromDatabase (mySql, rsTemp, "listCategoriesAndProducts") ' no categories defined in the store if rstemp.eof and pIdCategory="" then response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(7,"No ctg")) end if %> <% ' leaf category, list all products if rstemp.eof then '******************************************************** 'Next line commented by murali 'mySQL="SELECT products.idProduct, sku, description, dimensions, type, price, listPrice, smallImageUrl, count, colour, length, width, composition, details, isBundleMain, rental, visits FROM products, categories_products WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory="& pIdCategory&" AND listHidden=0 AND active=-1 AND idStore=" &pIdStore& " ORDER BY description" 'Next line commented by murali on 21/07/2006 'mySQL = "SELECT products.idproduct, sku, description, dimensions, type, price, listPrice, smallImageUrl, count, colour, length, width, composition, details, isBundleMain, rental, visits " 'mySQL = mySQL & " FROM products, categories_products " 'mySQL = mySQL & " WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory=" & pIdCategory & " AND listHidden=0 AND active=-1 AND idStore=" & pIdStore 'mySQL = mySQL & " GROUP BY products.idproduct, sku, description, dimensions, type, price, listPrice, smallImageUrl, count, colour, length, width, composition, details, isBundleMain, rental, visits " 'mySQL = mySQL & " ORDER BY sku asc" '*Added by murali on 21/07/2006 -- Toeliminate duplicate records' mySQL = "SELECT distinct sku " mySQL = mySQL & " FROM products, categories_products " mySQL = mySQL & " WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory=" & pIdCategory & " AND listHidden=0 AND active=-1 AND idStore=" & pIdStore mySQL = mySQL & " GROUP BY sku " mySQL = mySQL & " ORDER BY sku asc" '********************************************************* call getFromDatabasePerPage(mySql, rstemp,"listCategoriesAndProducts") %>
  <% if rstemp.eof then %> <% else rstemp.moveFirst rstemp.pageSize = pNumPerPage totalPages = rstemp.PageCount rstemp.absolutePage = curPage '******************************************* 'Added by murali '******************************************* 'pIdProduct = rstemp("idProduct") 'pSku = rstemp("sku") 'pDescription = rstemp("description") 'pListPrice = rstemp("listPrice") 'pSmallImageUrl = rstemp("smallImageUrl") 'pVisits = rstemp("visits") 'pCount = rstemp("count") 'pColour = rstemp("colour") 'pLength = rstemp("length") 'pWidth = rstemp("width") 'pComposition = rstemp("composition") 'pDetails = rstemp("details") 'pStock = getStock(pIdProduct) 'pPrice = getPrice(pIdProduct, pIdCustomerType, pIdCustomer) 'pDimensions = rstemp("dimensions") 'pFType = rstemp("type") 'pMyPrice = rstemp("price") 'pre_sku = rstemp("sku") 'pre_Description = rstemp("description") 'pre_Composition = rstemp("composition") %> <% 'count=count+1 'rstemp.movenext '******************************************* do while not rstemp.eof and count < rstemp.pageSize '***************************************************** 'Added by murali to eliminate duplicate rows '*****************************************************' mySQL = "SELECT products.idproduct, hex, sku, description, dimensions, type, price, listPrice, smallImageUrl, count, colour, length, width, composition, details, isBundleMain, rental, visits" mySQL = mySQL & " FROM products, categories_products " mySQL = mySQL & " WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory=" & pIdCategory & " AND listHidden=0 AND active=-1 AND idStore=" & pIdStore & " AND sku='" &rsTemp("sku") & "'" mySQL = mySQL & " GROUP BY products.idproduct, hex, sku, description, dimensions, type, price, listPrice, smallImageUrl, count, colour, length, width, composition, details, isBundleMain, rental, visits " mySQL = mySQL & " ORDER BY description asc" call getFromDatabase (mySQL, rsProduct, "listProductDetails") '********Addition by Murali on 21/07/2006 End here***********' '******************************************************************* ' Commented by murali on 21/07/2006 for replacing rsTemp by rsProduct '******************************************************************* 'pIdProduct = rstemp("idProduct") 'pSku = rstemp("sku") 'pDescription = rstemp("description") 'pListPrice = rstemp("listPrice") 'pSmallImageUrl = rstemp("smallImageUrl") 'pVisits = rstemp("visits") 'pCount = rstemp("count") 'pColour = rstemp("colour") 'pLength = rstemp("length") 'pWidth = rstemp("width") 'pComposition = rstemp("composition") 'pDetails = rstemp("details") 'pStock = getStock(pIdProduct) 'pPrice = getPrice(pIdProduct, pIdCustomerType, pIdCustomer) 'pDimensions = rstemp("dimensions") 'pFType = rstemp("type") 'pMyPrice = rstemp("price") '************************************************************************* 'Added by murali onm 21/07/2006 replaced rsTemp By rsProduct '*************************************************************************' 'pre_description="" Do while NOT rsProduct.EOF pHex = rsProduct("hex") pIdProduct = rsProduct("idProduct") pSku = rsProduct("sku") pDescription = rsProduct("description") pListPrice = rsProduct("listPrice") pSmallImageUrl = rsProduct("smallImageUrl") pVisits = rsProduct("visits") pCount = rsProduct("count") pColour = rsProduct("colour") pLength = rsProduct("length") pWidth = rsProduct("width") pComposition = rsProduct("composition") pDetails = rsProduct("details") pStock = getStock(pIdProduct) pPrice = getPrice(pIdProduct, pIdCustomerType, pIdCustomer) pDimensions = rsProduct("dimensions") pFType = rsProduct("type") pMyPrice = rsProduct("price") '*******Added by murali on 21/07/2006 ************** if pre_description<> rsProduct("description") Then pre_description=rsProduct("description") %> <% count=count+1 End IF '************************************' '******************************************* 'Added by murali on 20/07/2006 '******************************************* 'if pre_sku <> rstemp("sku") Then '' pre_sku=rsTemp("sku") %> <% '' count=count+1 'End IF 'If ((pre_Description = pDescription) AND (pre_composition = pComposition)) Then 'If (pre_Description = pDescription) Then ' If (pre_composition = pComposition) Then ' Elseif (pre_composition <> pComposition) Then %> <% 'pre_composition = rstemp("composition") 'count=count+1 'End If 'pre_Description = rstemp("description") 'pre_Composition = rstemp("composition") 'Elseif ((pre_Description <> pDescription) AND (pre_composition <> pComposition))Then 'Elseif (pre_Description <> pDescription) Then 'If (pre_composition = pComposition) Then 'Elseif (pre_composition <> pComposition) Then '******************************************* %> <% '******************************************* 'Added by murali '******************************************* 'pre_Composition = rstemp("composition") 'count =count + 1 'End If '' pre_Description = rstemp("description") '' count = count + 1 'End If '******************************************* '********************************** 'Next Line Commented by murali 'count = count + 1 '********************************** '******************************************* ' Commented by murali on 21/07/2006 'rstemp.moveNext '*******************************************' rsProduct.MoveNext Loop 'count=count+1 rstemp.MoveNext loop %>
<% response.write getMsg(8,"You are at") for f=indexCategories-1 to 0 step -1 response.write " > " & "" & arrCategories(f,0) &"" next %>

<% response.write getMsg(9,"No items") %>

<%=getMsg(10,"Page")& " " & curPage & " " & getMsg(11,"of") & " " & TotalPages%> <% if curPage > 1 then response.write("") end if if cInt(curPage) <> cInt(TotalPages) then response.write("") end if %>
<% end if ' eof for products else ' is not leaf category %>
  <% if pIdCategory<>"" then response.write getMsg(8,"Your are...") for f=indexCategories-1 to 0 step -1 response.write " > " & "" & arrCategories(f,0) &"" next else response.write getMsg(12,"Categories") end if %> <% do while not rstemp.eof pIdCategory = rstemp("idCategory") pCategoryDesc = rstemp("categoryDesc") pIdParentCategory = rstemp("idParentCategory") pImageCategory = rstemp("imageCategory") %> <%if trim(pImageCategory)<>"" then%> <%=pCategoryDesc%>
<%end if%> <%=pCategoryDesc%>

<% rstemp.moveNext loop end if %>

<%call closeDb()%>