<% 'This file is part of ProductCart, an ecommerce application developed and sold by Early Impact LLC. ProductCart, its source code, the ProductCart name and logo are property of Early Impact, LLC. Copyright 2001-2003. All rights reserved. You are not allowed to use, alter, distribute and/or resell any parts of ProductCart's source code without the written consent of Early Impact. To contact Early Impact, please visit www.earlyimpact.com. %> <% response.Buffer=true %> <%pcStrPageName="showspecials.asp"%> <%Dim iAddDefaultPrice, iAddDefaultWPrice%> <% on error resume next Dim query, conntemp, rsProducts, rsDisc, pDiscountPerQuantity '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' START: Check store on/off, start PC session, check affiliate ID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %> <% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' END: Check store on/off, start PC session, check affiliate ID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '******************************* ' Display Settings '******************************* ' This variable allows the admin to show some text above Specials -> move to Control Panel Dim pcStrSpecialsDesc pcStrSpecialsDesc = dictLanguage.Item(Session("language")&"_viewSpc_5") ' This variable controls whether NOT FOR SALE items should be shown Dim pcIntSpecialsNFS, queryNFS pcIntSpecialsNFS = 0 ' Not for sale items are shown pcIntSpecialsNFS = -1 ' Not for sale items are not shown if pcIntSpecialsNFS <> 0 then queryNFS = " AND formQuantity = 0 " else queryNFS = " " end if ' These variables show/hide information when products are shown with Page Style = L or M Dim pShowSKU, pShowSmallImg pShowSKU = scShowSKU ' If 0, then the SKU is hidden pShowSmallImg = scShowSmallImg ' If 0, then the small image is not shown ' Note: the size of the small image is set via the pcStorefront.css stylesheet '******************************* ' GET page style '******************************* ' Load the page style: check to see if a querystring ' or a form is sending the page style. Dim pcPageStyle pcPageStyle = LCase(Request.QueryString("pageStyle")) if pcPageStyle = "" then pcPageStyle = LCase(Request.Form("pageStyle")) end if if pcPageStyle = "" then pcPageStyle = LCase(bType) end if if pcPageStyle <> "h" and pcPageStyle <> "l" and pcPageStyle <> "m" and pcPageStyle <> "p" then pcPageStyle = LCase(bType) end if '******************************* ' GET page size '******************************* Dim pcv_ViewAllVar, newCount pcv_ViewAllVar=getUserInput(request("VA"),1) if NOT isNumeric(pcv_ViewAllVar) OR pcv_ViewAllVar="" then pcv_ViewAllVar=0 end if newCount=0 Dim iPageSize iPageSize=(scPrdRow*scPrdRowsPerPage) if request.queryString("iPageCurrent")="" then if request.queryString("page")="" then iPageCurrent=1 else iPageCurrent=server.HTMLEncode(request.queryString("page")) end if else iPageCurrent=server.HTMLEncode(request.queryString("iPageCurrent")) end if '******************************* ' GET sorting criteria '******************************* Dim ProdSort, querySort ProdSort="" & request("prodsort") if not validNum(ProdSort) then ProdSort="" & PCOrd end if if ProdSort="" then ProdSort="0" end if select case ProdSort Case "0": querySort = " ORDER BY products.SKU Asc" Case "1": querySort = " ORDER BY products.description Asc" Case "2": If Session("customerType")=1 then querySort = " ORDER BY products.btoBprice desc, products.price Desc" else querySort = " ORDER BY products.price Desc" End if Case "3": If Session("customerType")=1 then querySort = " ORDER BY products.bToBprice Asc, products.price Asc" else querySort = " ORDER BY products.price Asc" end if end select '******************************* ' GET Specials from DB '******************************* call openDb() if session("CustomerType")<>"1" then query1= " AND categories.pccats_RetailHide=0" else query1="" end if query="SELECT distinct products.idProduct,products.sku,products.description,products.price,products.listHidden,products.listPrice,products.serviceSpec,products.bToBPrice,products.smallImageUrl,products.noprices,products.stock,products.noStock,products.pcprod_HideBTOPrice,products.hotdeal,products.formQuantity,products.pcProd_BackOrder FROM products,categories_products,categories WHERE products.active=-1 AND products.hotdeal=-1 AND products.configOnly=0 AND products.removed=0 " & queryNFS & " AND categories_products.idProduct=products.idProduct AND categories.idCategory=categories_products.idCategory AND categories.iBTOhide=0 " & query1 & querySort set rsProducts=Server.CreateObject("ADODB.Recordset") rsProducts.CursorLocation=adUseClient rsProducts.CacheSize=iPageSize rsProducts.Open query, conntemp if err.number<>0 then call LogErrorToDatabase() set rsProducts=nothing call closedb() response.redirect "techErr.asp?err="&pcStrCustRefID end if dim iPageCount, count if NOT rsProducts.eof then rsProducts.MoveFirst rsProducts.PageSize=iPageSize pcv_strPageSize=iPageSize iPageCount=rsProducts.PageCount rsProducts.AbsolutePage=Cint(iPageCurrent) pcArray_Products = rsProducts.getRows() pcv_intProductCount = UBound(pcArray_Products,2)+1 else set rsProducts = nothing call closeDb() response.redirect "msg.asp?message=89" end if set rsProducts = nothing '******************************* ' Start: Set variables for "M" display '******************************* if pcPageStyle = "m" then 'Check if customers are allowed to order products dim iShow iShow=0 If scOrderlevel=0 then iShow=1 end if If scOrderlevel=1 AND session("customerType")="1" then iShow=1 End if Dim pCnt, pAddtoCart, pAllCnt 'reset count variables pCnt=Cint(0) pAllCnt=Cint(0) '// Loop until the total number of products to show if pcv_ViewAllVar=0 then newCount = pcv_strPageSize else newCount = 999999 end if '// Run through the products to count all products, products with options, and BTO products do while (pCnt < pcv_intProductCount) and (pCnt < newCount) pidrelation=pcArray_Products(0,pCnt) '// rsCount("idProduct") pserviceSpec=pcArray_Products(6,pCnt) '// rsCount("serviceSpec") pStock=pcArray_Products(10,pCnt) '// rsCount("stock") pNoStock=pcArray_Products(11,pCnt) '// rsCount("noStock") pcv_intBackOrder=pcArray_Products(15,pCnt) '// rs("pcProd_BackOrder") pCnt=pCnt+1 ' Check which items will have multi qty enabled, pcv_SkipCheckMinQty=-1 If pcf_AddToCart(pidrelation)=False Then pAllCnt=pAllCnt+1 End If loop pcv_SkipCheckMinQty=0 ' If all items on the page are either BTO or have options, ' do not show the quantity column or the Add to Cart button. if cint(pAllCnt) <> cint(pCnt) then pAddtoCart = 1 end if end if '******************************* ' End: Set variables for "M" display '******************************* '******************************* ' Build the page '******************************* %>

<%response.write dictLanguage.Item(Session("language")&"_viewSpc_2")%>

<% ' Show Specials description, if any if pcStrSpecialsDesc <> "" then %>
<%=pcStrSpecialsDesc%>
<% end if %> <%if HideSortPro<>"1" then%>
<%=dictLanguage.Item(Session("language")&"_viewCatOrder_5")%>
<%end if%> <% if pcv_ViewAllVar=0 then %> <% end if %>
<% if pcPageStyle = "m" then %>
<% end if %> <% '******************************* ' Add table headers for display ' styles L and M '******************************* %> <% if pcPageStyle = "l" then %> <% if pShowSmallImg <> 0 then %> <% end if %> <% if pShowSku <> 0 then %> <% end if %> <% elseif pcPageStyle = "m" then %> <% if iShow=1 then %> <% if pAddtoCart = 1 then %> <% end if %> <% end if %> <% if pShowSmallImg <> 0 then %> <% end if %> <% if pShowSku <> 0 then %> <% end if %> <% else %> <% end if %> <% '******************************* ' End table headers '******************************* '******************************* ' Load product information ' Loop through the products '******************************* 'Set the product count to zero count=0 if pcPageStyle = "m" then pCnt=Cint(0) pSQty=0 pAllCnt=Cint(0) end if '// Loop until the total number of products to show if pcv_ViewAllVar=0 then newCount = pcv_strPageSize else newCount = 999999 end if do while (tCnt < pcv_intProductCount) and (count < newCount) pidProduct=pcArray_Products(0,tCnt) '// rs("idProduct") pSku=pcArray_Products(1,tCnt) '// rs("sku") pDescription=pcArray_Products(2,tCnt) '// rs("description") pPrice=pcArray_Products(3,tCnt) '// rs("price") pListHidden=pcArray_Products(4,tCnt) '// rs("listhidden") pListPrice=pcArray_Products(5,tCnt) '// rs("listprice") pserviceSpec=pcArray_Products(6,tCnt) '// rs("serviceSpec") pBtoBPrice=pcArray_Products(7,tCnt) '// rs("bToBPrice") pSmallImageUrl=pcArray_Products(8,tCnt) '// rs("smallImageUrl") pnoprices=pcArray_Products(9,tCnt) '// rs("noprices") if isNULL(pnoprices) OR pnoprices="" then pnoprices=0 end if pStock=pcArray_Products(10,tCnt) '// rs("stock") pNoStock=pcArray_Products(11,tCnt) '// rs("noStock") pcv_intHideBTOPrice=pcArray_Products(12,tCnt) '// rs("pcprod_HideBTOPrice") if isNULL(pcv_intHideBTOPrice) OR pcv_intHideBTOPrice="" then pcv_intHideBTOPrice="0" end if if pnoprices=2 then pcv_intHideBTOPrice=1 end if pFormQuantity=pcArray_Products(14,tCnt) '// rs("FormQuantity") pcv_intBackOrder=pcArray_Products(15,tCnt) '// rs("pcProd_BackOrder") pidrelation=pcArray_Products(0,tCnt) '// rs("idProduct") '// Get sDesc query="SELECT sDesc FROM products WHERE idProduct="&pidrelation&";" set rsDescObj=server.CreateObject("ADODB.RecordSet") set rsDescObj=conntemp.execute(query) psDesc=rsDescObj("sDesc") set rsDescObj=nothing if pcPageStyle = "m" then pCnt=pCnt+1 end if tCnt=tCnt+1 %> <% '******************************* ' Show product information ' depending on the page style '******************************* ' FIRST STYLE - Show products horizontally, with images if pcPageStyle = "h" then %> <% i=i + 1 If i > (scPrdRow-1) then response.write "" i=0 End If end if ' SECOND STYLE - Show products vertically, with images if pcPageStyle = "p" then %> <% end if ' THIRD STYLE - Show a list of products, with a small image if pcPageStyle = "l" then %> <% end if ' FOURTH STYLE - Show a list of products, with multiple add to cart if pcPageStyle = "m" then %> <% end if iRecordsShown=iRecordsShown + 1 %> <% count=count + 1 loop %>
 <% response.write dictLanguage.Item(Session("language")&"_viewCat_P_9") %><% response.write dictLanguage.Item(Session("language")&"_viewCat_P_8") %><% response.write dictLanguage.Item(Session("language")&"_viewCat_P_10") %>
<% response.write dictLanguage.Item(Session("language")&"_viewCat_P_12") %>
<% response.write dictLanguage.Item(Session("language")&"_viewCat_P_7") %>   <% response.write dictLanguage.Item(Session("language")&"_viewCat_P_8") %> <% response.write dictLanguage.Item(Session("language")&"_viewCat_P_9") %> <% If session("customerType")="1" then response.write dictLanguage.Item(Session("language")&"_viewCat_P_11") else response.write dictLanguage.Item(Session("language")&"_viewCat_P_10") end if %>
<%' If page style is M, show the Add to Cart button when ' products can be added to the cart from this page. if pcPageStyle = "m" then %> <% if iShow=1 and clng(pSQty)<>0 then %>
" id="submit">
<% end if %>
<% end if %> <% if pcv_ViewAllVar=0 then %> <% end if %> <% call closeDb() %>
<%' GBDG mod for add-to-cart confirmation mod %> <%' GBDG mod for add-to-cart confirmation mod %>