How to Move the Small Search Box to the Root Directory
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.
Overview
The small search box ( SmallSearchBox08.asp) will display a waiting dialog window while search results are loading. If you have moved your home page to the site root this feature will not function properly. This document contains information about how to retain the waiting dialog box on your custom home page.
The following assumptions are used in this section:
- The “productcart” directory has not been renamed. If you have renamed it, no problem. Just adjust the links accordingly.
- The “productcart” directory is in the root. That is, the file SmallSearchBox08.asp (which contains the small search box) is two levels down from the root and will be moved two levels up. If this is not the case, change some of the links mentioned below so that they are consistent with your directory structure.
Instructions
The following is a list of tasks to be performed. Please make sure you follow these instructions carefully. Please also note that ProductCart does not provide technical support on implementing these code changes.
Some of the steps below assume that you are using Adobe® Dreamweaver®. If not, you can perform the same tasks manually (e.g. change links for files and folder so that they point to the correct location).
- Recreate locally the Web store that you have on your Web server. You don't need all the files locally, you just need the folder structure.
- Create a Web site in Dreamweaver where the root folder of the Web site is the root folder of your local Web store.
- Download the file “SmallSearchBox08.asp” to the your local “pc” folder.
- Open the file with Dreamweaver and save it to the root. When the software asks you whether links should “Update links?”, say “Yes”.
- With the same file still open, you will need to find the following strings:
<% Response.Write(pcf_InitializePrototype()) response.Write(pcf_ModalWindow(dictLanguage.Item(Session("language")&"_advSrca_23"), "small_search", 200)) %>
… and replace them with:<link href='ProductCart/pc/screen.css' rel='stylesheet' type='text/css' /> <script type='text/javascript' src='ProductCart/includes/javascripts/highslide.html.packed.js'></script> <a href="javascript:;" id="small_search" onclick="return hs.htmlExpand(this, { contentId: 'modal_small_search', align: 'center', width: 200 } )" class="highslide"></a> <div id='modal_small_search' class="highslide-maincontent"> <div align='center'>Searching... Please Wait.</div> </div> <script language="JavaScript"> <!-- function pcf_Close_small_search() { var t=setTimeout("hs.close('small_search')",50) } function pcf_Open_small_search() { document.getElementById('small_search').onclick() } hs.graphicsDir = 'productcart/pc/images/highslide/'; //--> </script>
- You are almost done. Since you might include the small search box in a file that does not contain ProductCart store settings, you will need to change two variables in the code. Specifically, locate the string:
pcIntPreferredCountSearch =(scPrdRow*scPrdRowsPerPage)
…and replace it with:pcIntPreferredCountSearch = 12 bType = "h"
where the first variable indicates how many results should be returned in the search and the second one indicates the way results should be presented. The options for this second variable are:- h = horizontal
- l = list
- m = list, with multiple add to cart
- p = vertical (one item per row)
- Save the file.
You can now include “SmallSearchBox08.asp” in an ASP file that exists in the root of your Web site and have the small search box work from there.
If you have changed the name of the “ProductCart” folder (which is very common) use the name of your renamed folder in place of “ProductCart” in the code above.