|
|
SearchSearch Form | Product Search | Site Search O3 allows you to put separate product and site search results tables anywhere in your web pages with a few simple lines of code... You can see the search in action on the test page. Search FormYou can put the search form anywhere on your web pages with this code:
You can get the form to submit the data to a different page by setting the variable 'search_page' (above the include statement). If it's blank it'll submit the search data to the current page. This can also be set globally in the settings, in which case you don't need to specify it here. To hide the 'Order By' field, set the value of 'noord' to 'Y'. The product search orders by price by default. Product SearchThe search data from the search form is picked up by this script which searches the database for matching products and displays them in a table. It searches the product name, description and category for any partial word match. The results table contains these rows: Image, Name, Description, Price (inc. handling) (& Shipping), Web page (a link to). The background color of the result rows alternates to make each line stand out better. You can set these two colours in the Settings. Also in the settings, you can set the maximum number of products a search should return - 'searchlimit'. To include the search results in your web page use this code:
Site SearchThe search data from the search form can also be picked up by this script which searches your entire website by recursively scanning all the directories, and looking in all the defined file types for matching text. The search is case insensitive. It filters out all the HTML tags from web pages before searching for the search text. It searches the product name, description and category for any partial word match. The results table contains these rows:
The background color of the result rows alternates to make each line stand out better. You can set these two colours in the Settings. Also in the settings, you can set 'searchlength' - which is how much text from each file the search should show. To include the search results in your web page use this code:
You can include and exclude files and directories in a few different ways. To exclude a file, either put the exclude text ('!SSIGNORE' by default) in it, or list it in the exclude_files array (these settings are defined in the script itself: Here's the code from the top of site-search.php defining this stuff. It's pretty self-explanatory. You can add any number of elements to the array, just put a comma between them, and ensure they're in quotes as in the example:
OfficeTrio: The Integrated ECommerce Solution
|