<% '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 %> <%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 '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '******************************* ' GET PAGE SETTINGS FROM DB '******************************* Dim pcIntNewArrCount, pagesize, pcStrNewArrDesc, pcIntNewArrNFS, queryNFS, pcIntNewArrInStock, queryInStock, pcNDays, pShowSKU, pShowSmallImg, pcPageStyle call openDb() 'APP-S '--- Update Apparel Product Stock %> <% '--- End of Update 'APP-E query="SELECT pcNAS_NewArrCount, pcNAS_Style, pcNAS_PageDesc, pcNAS_NDays, pcNAS_NotForSale, pcNAS_OutOfStock, pcNAS_SKU, pcNAS_ShowImg FROM pcNewArrivalsSettings;" set rs=Server.CreateObject("ADODB.RecordSet") set rs=connTemp.execute(query) if not rs.eof then pcIntNewArrCount=rs("pcNAS_NewArrCount") pcPageStyle=rs("pcNAS_Style") pcStrNewArrDesc=rs("pcNAS_PageDesc") pcNDays=rs("pcNAS_NDays") pcIntNewArrNFS=rs("pcNAS_NotForSale") pcIntNewArrInStock=rs("pcNAS_OutOfStock") pShowSKU=rs("pcNAS_SKU") pShowSmallImg=rs("pcNAS_ShowImg") end if set rs=nothing if isNULL(pcIntNewArrCount) or (pcIntNewArrCount="0") then pcIntNewArrCount = 14 end if pagesize = pcIntNewArrCount if len(pcNDays)<1 then pcNDays=15 end if if pcIntNewArrNFS <> 0 then queryNFS = "((products.formQuantity)=0) AND" else queryNFS = " " end if if isNULL(pShowSKU) OR (pShowSKU="") then pShowSKU=0 end if if isNULL(pShowSmallImg) OR (pShowSmallImg="") then pShowSmallImg=0 end if if pcPageStyle = "" then pcPageStyle = LCase(Request.QueryString("pageStyle")) if pcPageStyle = "" then pcPageStyle = LCase(Request.Form("pageStyle")) end if 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 new arrivals from DB '******************************* if session("CustomerType")<>"1" then query1= " AND ((categories.pccats_RetailHide)=0)" else query1="" end if pcTodayDate=Date() if SQL_Format="1" then pcTodayDate=Day(pcTodayDate)&"/"&Month(pcTodayDate)&"/"&Year(pcTodayDate) else pcTodayDate=Month(pcTodayDate)&"/"&Day(pcTodayDate)&"/"&Year(pcTodayDate) end if if scdb="SQL" then y="'" else y="#" end if if pcIntNewArrInStock <> 0 then 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.pcprod_EnteredOn, products.formQuantity, products.pcProd_BackOrder FROM (products INNER JOIN categories_products ON products.idProduct = categories_products.idProduct) INNER JOIN categories ON categories_products.idCategory = categories.idCategory WHERE (((products.stock)>0) AND ((products.formQuantity)=0) AND ((products.active)=-1) AND ((products.configOnly)=0) AND ((products.removed)=0) AND (("&y&pcTodayDate&y&"-[products].[pcprod_EnteredOn])<="& pcNDays &") AND ((categories.iBTOhide)=0) AND ((categories.pccats_RetailHide)=0)) OR (((products.noStock)=-1) AND ((products.formQuantity)=0) AND ((products.active)=-1) AND ((products.configOnly)=0) AND ((products.removed)=0) AND (("&y&pcTodayDate&y&"-[products].[pcprod_EnteredOn])<="& pcNDays &") AND ((categories.iBTOhide)=0) AND ((categories.pccats_RetailHide)=0)) ORDER BY products.pcprod_EnteredOn DESC;" else 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.pcprod_EnteredOn, products.formQuantity, products.pcProd_BackOrder FROM (products INNER JOIN categories_products ON products.idProduct = categories_products.idProduct) INNER JOIN categories ON categories_products.idCategory = categories.idCategory WHERE ("&queryNFS&" ((products.active)=-1) AND ((products.configOnly)=0) AND ((products.removed)=0) AND (("&y&pcTodayDate&y&"-[products].[pcprod_EnteredOn])<="& pcNDays &") AND ((categories.iBTOhide)=0)"&query1&") ORDER BY products.pcprod_EnteredOn DESC;" end if set rsProducts=server.CreateObject("ADODB.Recordset") set rsProducts=conntemp.execute(query) if err.number<>0 then call LogErrorToDatabase() set rsProducts=nothing call closedb() response.redirect "techErr.asp?err="&pcStrCustRefID end if if NOT rsProducts.eof then pcArray_Products = rsProducts.getRows() pcv_intProductCount = UBound(pcArray_Products,2)+1 else set rsProducts = nothing call closeDb() response.redirect "msg.asp?message=93" 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) '// Run through the products to count all products, products with options, and BTO products do while (pCnt < pcv_intProductCount) and (pCnt < pagesize) 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")&"_viewNewArrivals_2")%>

<% ' Show New Arrival description, if any if pcStrNewArrDesc <> "" then %>
<%=pcStrNewArrDesc%>
<% 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 tCnt=Cint(0) do while (tCnt < pcv_intProductCount) and (count < pagesize) 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 %> <% 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 call closeDb() %>
<%' GBDG mod for add-to-cart confirmation mod %> <%' GBDG mod for add-to-cart confirmation mod %>