How to Hide Category Search Results
Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.
In ProductCart, there is a hardcoded variable at the top of pc/showsearchresults.asp that allows you to quickly turn off category information (list of categories that match the search criteria) on the search results page. This may be useful on large product catalogs when having category information in the search results negatively impacts the overall search speed.
To turn off category search results, locate the following code in the file pc/showsearchresults.asp:
Set to "True" to disable category search
Changing this hardcoded variable value will affect all searches. If you only want Category Search Results to be disabled in some cases, you will need to use additional logic in the source code. For example, you could pass a new querystring value to the search results page, and then use that querystring value to turn the feature on and off.
For instance, assuming that you are passing a querystring called “showCategoryResults” with value “No” to turn off Category Search Results, the code would be written as follows on pc/showsearchresults.asp:
In ProductCart, there is a hardcoded variable at the top of pc/showsearchresults.asp that allows you to quickly turn off category information (list of categories that match the search criteria) on the search results page. This may be useful on large product catalogs when having category information in the search results negatively impacts the overall search speed.
To turn off category search results, locate the following code in the file pc/showsearchresults.asp:
Dim pcv_strHideCatSearch pcv_strHideCatSearch = False '//
Set to "True" to disable category search
- Download the file pc/showsearchresults.asp
- Make a back-up copy
- Edit the file by replacing “False” with “True” in the code shown above
- Save the edited file and re-upload it to the pc folder on the Web server
Changing this hardcoded variable value will affect all searches. If you only want Category Search Results to be disabled in some cases, you will need to use additional logic in the source code. For example, you could pass a new querystring value to the search results page, and then use that querystring value to turn the feature on and off.
For instance, assuming that you are passing a querystring called “showCategoryResults” with value “No” to turn off Category Search Results, the code would be written as follows on pc/showsearchresults.asp:
Dim pcv_strHideCatSearch, pcv_showCategoryResults pcv_showCategoryResults=request("showCategoryResults") IF lcase(pcv_showCategoryResults) = "no" THEN pcv_strHideCatSearch = True ELSE pcv_strHideCatSearch = False END IF