% ' Oddhobby Weird Store - bizarre, rare and unusual toys, candy, books ' Weird Store & Oddhobby & Oddhobbies are Trademarks of JHLMC, Inc. ' United States - 2003 ' ' http://www.oddhobby.com m ' Details: list active categories on the store. If is leaf category, list products %> <% dim mySQL, connTemp, rsTemp, pIdCategory, pCategoryDesc, totalPages, count 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 pDefaultLanguage = getSettingKey("pDefaultLanguage") pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode") pCurrencySign = getSettingKey("pCurrencySign") pDecimalSign = getSettingKey("pDecimalSign") pCompany = getSettingKey("pCompany") pCompanyLogo = getSettingKey("pCompanyLogo") pAuctions = getSettingKey("pAuctions") pListBestSellers = getSettingKey("pListBestSellers") pNewsLetter = getSettingKey("pNewsLetter") pPriceList = getSettingKey("pPriceList") pStoreNews = getSettingKey("pStoreNews") pOneStepCheckout = getSettingKey("pOneStepCheckout") pAffiliatesStoreFront = getSettingKey("pAffiliatesStoreFront") pCategoriesAlphOrder = getSettingKey("pCategoriesAlphOrder") ' defined 10 records per page const numPerPage = 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(100,2) indexCategories = 0 pUrlString = Cstr("") 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 "oddhobby_message.asp?message="&Server.Urlencode(dictLanguage.Item(Session("language")&"_listcategoriesandproducts_6") ) end if pCategoryDescSw = rsTemp("categoryDesc") pIdCategorySw = rsTemp("idCategory") pImageCategory = rsTemp("imageCategory") call switchCategoryLanguage(session("language"), pIdCategorySw, pCategoryDescSw) pIdCategory2 = rsTemp("idParentCategory") arrCategories(indexCategories,0) = pCategoryDescSw arrCategories(indexCategories,1) = pIdCategorySw indexCategories = indexCategories + 1 loop end if 'idParentCategory ' get child categories if pIdCategory="" then mySQL="SELECT idCategory, categoryDesc, idParentCategory, imageCategory FROM categories WHERE idParentCategory=1 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 "oddhobby_message.asp?message="&Server.Urlencode(dictLanguage.Item(Session("language")&"_listcategoriesandproducts_1") ) end if %><% %>
| <% ' leaf category, list all products if rstemp.eof then mySQL="SELECT products.idProduct, description, price, bTobPrice, smallImageUrl, stock, isBundleMain FROM products, categories_products WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory="& pIdCategory&" AND listHidden=0 AND active=-1 ORDER BY description" call getFromDatabasePerPage(mySql, rstemp,"listCategoriesAndProducts") %> <% if rstemp.eof then response.write dictLanguage.Item(Session("language")&"_listcategoriesandproducts_4") else rstemp.moveFirst rstemp.pageSize = numPerPage totalPages = rstemp.PageCount rstemp.absolutePage = curPage do while not rstemp.eof and count < rstemp.pageSize pIdProduct = rstemp("idProduct") pDescription = rstemp("description") pPrice = rstemp("price") pBtoBPrice = rstemp("bToBPrice") pSmallImageUrl = rstemp("smallImageUrl") pStock = rstemp("stock") pIsBundleMain = rsTemp("isBundleMain") call switchProductsLanguage(session("language"), pIdProduct, pDetails, pDescription) %><% count = count + 1 rstemp.moveNext loop %> <% end if ' eof for products else ' is not leaf category %> <% do while not rstemp.eof pIdCategory = rstemp("idCategory") pCategoryDesc = rstemp("categoryDesc") pIdParentCategory = rstemp("idParentCategory") pImageCategory = rstemp("imageCategory") call switchCategoryLanguage(session("language"), pIdCategory, pCategoryDesc) %> <%if trim(pImageCategory)<>"" then%> <% rstemp.moveNext loop end if call closeDb() %> |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Sample category products shown
above:
Action Figures
◊ Spawn,
Eminem *Plushies = Plushy, stuffed dolls |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||