% '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%>
|
| <% if pcPageStyle = "m" then %> <% end if %> <% if pcv_ViewAllVar=0 then %> <% end if %> <% call closeDb() %> |