<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "18, 33, 55, 108, 150, 151, 152, 156, 157, 158, 159, 160, 161, 265, 266, 294, 295, 296, 648, 779, 1182, 1183, 1184, 1236, 1237" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== 'Need extra recordset object Set objRecordSet3 = Server.CreateObject("ADODB.Recordset") '----------------------------------------------- 'COLLECT VALUES FROM FORM '----------------------------------------------- V_ID = request.querystring("V_ID") P_ID = request.querystring("P_ID") PT_ID = request.querystring("PT_ID") numPageStartPosition = request.querystring("numPageStartPosition") strShowBackLink = request.querystring("strShowBackLink") if not isnull(V_ID) and V_ID <> "" then strKeywords = "" strPageHistory = request.querystring("strPageHistory") strSearchCriteria = request.querystring("strSearchCriteria") strKeywords = request.querystring("strKeywords") '----------------------------------------------- 'SECURITY CHECKS '----------------------------------------------- If V_ID="" then V_ID = 0 If PT_ID="" then PT_ID = 0 If Not IsNumeric(V_ID) then response.redirect("error.asp") If Not IsNumeric(P_ID) then response.redirect("error.asp") If Not IsNumeric(PT_ID) and PT_ID <> "all" then response.redirect("error.asp") If numPageStartPosition = "" Or Not IsNumeric(numPageStartPosition) then numPageStartPosition = 1 numPageStartPosition = Cint(numPageStartPosition) 'If this gets set, don't show the product. This is ' security for language-specific products blnNoShow = false '----------------------------------------------- 'FORMAT QUERY AND RUN IT '----------------------------------------------- strQuery2 = "SELECT PT_Live, PT_Name" & CStr(numLanguageID) & ", P_StrapLine" & CStr(numLanguageID) & ", P_Live, P_Name" & CStr(numLanguageID) & ", P_SpecTable" & CStr(numLanguageID) & ", P_Desc" & CStr(numLanguageID) & ", P_HyperLink" & CStr(numLanguageID) & ", P_OrderVersionsBy, P_VersionDisplayType FROM (((tblCactuShopVersions INNER JOIN tblCactuShopTaxRates ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE P_ID=" & P_ID & " AND V_Live='y' AND P_Live='y' AND PT_Live='y'" Call ExecuteSQL(strQuery2, numCursorType, objRecordSet3) If not (objRecordSet3.BOF And objRecordSet3.EOF) then P_OrderVersionsBy = objRecordSet3("P_OrderVersionsBy") P_VersionDisplayType = objRecordSet3("P_VersionDisplayType") blnNoShow = objRecordSet3("P_Name" & CStr(numLanguageID)) & "" = "" 'Set the string to use as the title of this page - good for search engines! strPageTitleHTML = objRecordSet3("P_Name" & CStr(numLanguageID)) & " | " & GetString("Config_Webshopname") strMetaDescHTML = left(objRecordSet3("P_Desc" & CStr(numLanguageID)), 300) end if '----------------------------------------------- 'PRODUCT TRACKING - CAN BE TURNED ON OR OFF '----------------------------------------------- if Application(LICENSENUMBER & "tracking") = "y" then strQuery = "INSERT INTO tblCactuShopProductStats (PS_ProdNo, PS_Date, PS_IP) VALUES (" & _ P_ID & "," & strDateDelimiter & _ ReverseFormatYear(Now()) & strDateDelimiter & ",'" & _ Request.ServerVariables("HTTP_HOST") & "')" Call ExecuteSQL(strQuery, numCursorType, objRecordSet) End if If not (objRecordSet3.BOF And objRecordSet3.EOF) and not blnNoShow then '----------------------------------------------- 'GET LOCATION BAR 'We've moved this up so that we can check that 'all categories below us are 'legal' for 'this language. If not, we should show 'the unavailable sign '----------------------------------------------- select case strPageHistory case "cat": strLocationBar = "" & GetString("ContentText_Categories") & "" case "basket": strLocationBar = "" & GetString("ContentText_Basket") & "" case "search" strLocationBar = "" & GetString("ContentText_Search") & "" strLocationBar = "" & GetString("ContentText_SearchResults") & "" case "related": strLocationBar = "" & GetString("ContentText_RelatedProduct") & "" case "wishlist": strLocationBar = "" & GetString("PageTitle_WishList") & "" case Else: strLocationBar = "" & GetString("ContentText_Home") & "" end select 'Add on the trail strLocationBar = strLocationBar & " > " 'Add on any categories we've been through If PT_ID <> "0" and not isnull(PT_ID) and PT_ID <> "all" then strQuery = "SELECT PT_Name" & CStr(numLanguageID) & ", PT_MotherProdType FROM tblCactuShopProdtype WHERE PT_ID = " & PT_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) If Not (objRecordSet.BOF And objRecordSet.EOF) Then 'Get category name PT_MotherProdType = objRecordSet("PT_MotherProdType") strSectionLink = "" & objRecordSet("PT_Name" & CStr(numLanguageID)) & " > " & chr(13) objRecordSet.close 'Get mothers name numMotherID = PT_MotherProdType Do While numMotherID > 0 strQuery = "SELECT PT_ID, PT_Name" & CStr(numLanguageID) & ", PT_MotherProdType FROM tblCactuShopProdtype WHERE PT_ID = " & numMotherID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) if not (objRecordSet.bof and objRecordSet.eof) then numMotherID = objRecordSet("PT_MotherProdType") strMothers = "" & objRecordSet("PT_Name" & CStr(numLanguageID)) & " > " & strMothers else numMotherID = 0 end if objRecordSet.close loop strLocationBar = strLocationBar & strMothers & strSectionLink Else objRecordSet.Close End If End If strLocationBar = strLocationBar & objRecordSet3("P_Name" & CStr(numLanguageID)) end if '----------------------------------------------- 'BUILDPAGE DOWN HERE BECAUSE THANKS TO THE NEW 'CODE TO ADD METATAGS AND PAGETITLE, THIS NEEDS 'TO COME AFTER PRODUCT INFO PULLED OUT. '----------------------------------------------- %> <% '----------------------------------------------- 'READ PAGE TEMPLATE FROM FILE '----------------------------------------------- Call ReadFromTemplate(strTemplateLocation, aryPageTemplate, strBasketHTML, strCategoryListHTML) '----------------------------------------------- 'WRITE FIRST HALF OF PAGE HTML '----------------------------------------------- response.write(aryPageTemplate(0)) If objRecordSet3.recordcount = 0 or blnNoShow then %>
<% WriteString("ContentText_ProductUnavailable") %>
<% else %> <% '----------------------------------------- 'DO 'PEOPLE WHO BOUGHT...' 'but don't include anything that was 'listed in the related products bit '----------------------------------------- %>
<% response.write "" & objRecordSet3("P_Name" & CStr(numLanguageID)) & "
" & strLocationBar & "" %>
<% '----------------------------------------------- 'SHOW RED STRAPLINE ROW IF VALUE IS NOT BLANK '----------------------------------------------- If objRecordSet3("P_StrapLine" & CStr(numLanguageID))<>"" then %> <% end if %>
<% =objRecordSet3("P_StrapLine" & CStr(numLanguageID)) %>
<% Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject") aryFileTypes = Split(Application(LICENSENUMBER & "allowedimages"), ",") strProductPath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products/") strProductLargePath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products_large/") '----------------------------------------- 'FIND AND SHOW NORMAL IMAGE (IF ANY) '----------------------------------------- strFileName = GetFileLocation(strProductPath, P_ID, aryFileTypes, objFileSystem) If strFileName = "" Then strFileStatus = "" Else strFileStatus = "" End if '----------------------------------------- 'FIND AND SHOW LARGE IMAGE (IF ANY) '----------------------------------------- strFileName = GetFileLocation(strProductLargePath, P_ID, aryFileTypes, objFileSystem) If strFileName = "" Then strFileStatus2 = "" Else If gfxSpex(strProductLargePath & "\" & strFileName, imgW, imgH, c, strType) = True Then strImageTag = server.URLencode("") strFileStatus = "" & strFileStatus & "" strFileStatus2 = "" & GetString("ContentText_LargeView") & "   " End if End if '----------------------------------------- 'HANDLE LOGO DISPLAY '----------------------------------------- response.write(strFileStatus) P_Desc = objRecordSet3("P_Desc" & CStr(numLanguageID)) 'Replace the description with break tags If Application(LICENSENUMBER & "convertdescbreaks") = "y" then P_Desc = replace(P_Desc, vbcrlf, "
") end if response.write(Highlight(P_Desc, strKeywords, "searchtexthighlight")) %>


<% response.write(strFileStatus2) If objRecordSet3("P_HyperLink" & CStr(numLanguageID))<>"" then %> <% WriteString("ContentText_MoreInfo") %>: " target="_new"><% =objRecordSet3("P_HyperLink" & CStr(numLanguageID)) %> <% end if %>
<% =objRecordSet3("P_SpecTable" & CStr(numLanguageID)) %>
<% objRecordSet3.close numBackgroundCounter = 0 '----------------------------------------------- 'GENERATE TABLE OF VERSIONS '----------------------------------------------- strVersionsOrderBy = Application(LICENSENUMBER & "orderby_versions") If P_OrderVersionsBy <> "" then strVersionsOrderBy = P_OrderVersionsBy If strVersionsOrderBy = "" then strVersionsOrderBy = "V_Name" if strVersionsOrderBy = "V_Name" or strVersionsOrderBy = "V_Desc" then strVersionsOrderBy = strVersionsOrderBy & CStr(numLanguageID) If strDatabaseType = "access" Then strQuery2 = "SELECT DISTINCTROW tblCactuShopProducts.P_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_Price, tblCactuShopVersions.V_Weight, tblCactuShopVersions.V_RRP, tblCactuShopVersions.V_CodeNumber, tblCactuShopVersions.V_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_ID, tblCactuShopVersions.V_Desc" & CStr(numLanguageID) & ", tblCactuShopTaxRates.T_Taxrate, tblCactuShopVersions.V_Live, tblCactuShopVersions.V_Quantity, tblCactuShopVersions.V_QuantityWarnLevel, " & strVersionsOrderBy & " As OrderByBit FROM (tblCactuShopVersions INNER JOIN ((tblCactuShopProducts INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID) ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopTaxRates ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID WHERE tblCactuShopVersions.V_Live ='y' AND P_ID = " & P_ID & " AND P_Live = 'y' AND PT_Live = 'y' AND V_Name" & CStr(numLanguageID) & " <> '' ORDER BY " & strVersionsOrderBy Else strQuery2 = "SELECT DISTINCT tblCactuShopProducts.P_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_Price, tblCactuShopVersions.V_Weight, tblCactuShopVersions.V_RRP, tblCactuShopVersions.V_CodeNumber, tblCactuShopVersions.V_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_ID, tblCactuShopVersions.V_Desc" & CStr(numLanguageID) & ", tblCactuShopTaxRates.T_Taxrate, tblCactuShopVersions.V_Live, tblCactuShopVersions.V_Quantity, tblCactuShopVersions.V_QuantityWarnLevel, " & strVersionsOrderBy & " As OrderByBit FROM (((tblCactuShopTaxRates INNER JOIN tblCactuShopVersions ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE tblCactuShopVersions.V_Live ='y' AND P_ID = " & P_ID & " AND P_Live = 'y' AND PT_Live = 'y' AND V_Name" & CStr(numLanguageID) & " <> '' ORDER BY " & strVersionsOrderBy End If Call ExecuteSQL(strQuery2, numCursorType, objRecordSet3) '----------------------------------------- 'CREATE RETURN URL '----------------------------------------- strReturnURL = "product.asp:::P_ID=" & P_ID & "|||PT_ID=" & PT_ID & "|||numPageStartPosition=" & numPageStartPosition strVersionPath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_versions/") strVersionLargePath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_versions_large/") 'Show the versions %><% objRecordSet3.Close %>
<% WriteString("ContentText_RelatedProducts") %>:
- this functionality is not included in the lite version.
<% WriteString("ContentText_PeopleWhoBought") %>:
- this functionality is not included in the lite version.
<% WriteString("ContentText_TryTheseCategories") %>:
- this functionality is not included in the lite version.

<% If strShowBackLink<>"n" then %> << <% WriteString("ContentText_GoBack") %> <% end if %>
<% end if '----------------------------------------------- 'WRITE LAST HALF OF PAGE HTML '----------------------------------------------- response.write(aryPageTemplate(1)) '----------------------------------------------- 'CLOSE DATA CONNECTIONS '----------------------------------------------- objDataConn.Close set objDataConn = nothing %>