Help Version: 2.12
Last Update: 04/02/03

Custom Searches

By default, quikstore includes search parameters for high price, low price, category, product and keyword. The search page template allows customers to search by category, keyword, or a combination of both.


Add High/Low Price Search

Option 1 - User entered data

<FORM METHOD=POST ACTION=http://www.quikstore.com/cgi-bin/quikstore.cgi>
    <INPUT TYPE="hidden" NAME="page" VALUE="search.html">
    Enter Minimum Price: <INPUT TYPE="text" NAME="low_range">
    Enter Maximum Price: <INPUT TYPE="text" NAME="high_range">
    <INPUT TYPE="submit" NAME="search" VALUE="Search">
</FORM>

Enter Minimum Price:
Enter Maximum Price:

Option 2 - Radio buttons for price range

<FORM METHOD=POST ACTION=http://www.quikstore.com/cgi-bin/quikstore.cgi>
    <input type="radio" name="high_range" value="50.00"> Items under $50
    <input type="radio" name="high_range" value="100.00"> Items under $100
    <input type="radio" name="high_range" value="200.00"> Items under $200
     <input type="submit" name="search" value="Search">
</FORM>

Items under $50
Items under $100
Items under $200
User Defined Search Parameters

 
Quikstore also allows you to define your own search parameters.

Example: Our Quikstore Toy Store has items for different age groups. We'll define each of our age groups for each product in the USER_1 field in the database. We've chosen the terms UpTo2, age3-5, age6-8, age8-10, and ALL. Each product could contain one or more terms.

Step 1: Define our search

In a text editor open the qs_main.cgi file typically found in the server_files/cgi-bin/ directory and locate the SEARCH_PARAMETERS section.

To create a new query, we assign a name, "common name", database field(s), comparison, and data type. If we are creating a price query, our data type would be number, a text match would be a string. In our toy store example, we would like to create an age query, matching USER_1 (database field 11) using a text search.

Here's how it would look in the qs_main:

age_query=age|11|eq|string

The "eq" entered in the comparison field above is used in place of an = sign.

Step 2: Create our form

We will create a search form using radio buttons, but we could use a dropdown list just as easily. We can also create custom links such as quikstore.cgi?search=yes&category=all&age=UpTo2 as well. Each of these methods will work to query the database using our new search parameter.

<FORM METHOD=POST ACTION=http://www.quikstore.com/cgi-bin/quikstore.cgi>

     <input type="radio" name="age" value="UpTo2"> Up to age 2
     <input type="radio" name="age" value="age3-5"> Ages 3-5
     <input type="radio" name="age" value="age6-8"> Ages 6-8
     <input type="radio" name="age" value="ALL"> All Ages

     <input type="submit" name="search" value="Search">
</FORM>

Up to age 2
Ages 3-5
Ages 6-8
All Ages

You could also add these 4 input fields to an existing form, such as the search form used in the search.html page.

You can name a query anything you like as long as you follow the above format. And you can have as many search parameters as you like.

Keep in mind though, if you combine search parameters like this:

<FORM METHOD=POST ACTION=http://www.quikstore.com/cgi-bin/quikstore.cgi>

     <select name="category">
       <option value="Girls">Girls Toys<option>
       <option value="Boys">Boys Toys<option>
     </select>

     <input type="radio" name="age" value="UpTo2"> Up to age 2
     <input type="radio" name="age" value="age3-5"> Ages 3-5
     <input type="radio" name="age" value="age6-8"> Ages 6-8
     <input type="radio" name="age" value="ALL"> All Ages

     <input type="submit" name="search" value="Show Products">

</FORM>

...it will only find the selected age groups in the selected category of products.

 


Copyright 1997-2003 i-Soft, LLC