[ Previous ][ Contents ][ Chapter TOC ][ Index ][ Next ]
Chapter 2: Installing and Using NetStores

Setting up the search (gen-srch) interface

The storefront for the gen-srch interface includes any introductory text and images you want to use followed by a form that lets the customer search for products. Internally, the catalog interface uses flat ASCII files to generate search forms and search results. It also generates forms for ordering.

"Search a large catalog (gen-srch)" For an online example of this interface, see http://www.netstores.com/dwos-bin/gen-srch?mal or http://www.netstores.com/dwos-bin/gen-srch?ent (use "1" for the account number and "captain" for the password.

Directory structure

The ./dwos/data/store-abbrev directory for a store that uses the search (gen-srch) interface contains numerous directories and files.

Item file structure

NetStores's gen-srch interface uses a file called itmfil.asc to provide database-like searching behavior. This file is a variable-length "flat" ASCII file.

Each line in the file stores a single record for a single product. All records in the file must have the same field layout. Fields are separated by the "|" (pipe) character. Each line must end with "|" followed by a line break.

For example, this record:

    983CD|ROCK|BLUES TRAVELER|RUNAROUND|11.98|CD|A+M|00|

has these fields:

    item_#|category|artist|title|price|media|label|checkfields|

Decide what fields you want to include in your itmfil.asc file. Any field you want to include in the search form or the order form must be stored in this file. For performance reasons, you should avoid including other fields that will not be used in the search form or the order form.

NetStores allows advanced users to use wildcard characters and even UNIX-style regular expressions in their search strings.

--------------------------
--> To create a product list for searching:

  1. In the ./dwos/data/store-abbrev directory, create the itmfil.asc file as described in the previous paragraphs. If your product data is already stored in a database, you most likely can use a reporting tool to generate itmfil.asc from your database.

    You should include the following field types in itmfil.asc:

    • Unique Key (required): Usually this is the product code or item number. Each record must either have a unique (different) value for each record. This unique value may be a single field value or a combination of the values in two Key fields. Key 1 must be the first field in each record. If you have a second key field, it must be the second field in each record. You cannot use double quotes (") in the values in any key fields.
    • Description (at least one required): A description of the item or some aspect of the item. For example, you could have description fields for Title, Author, Publisher, and Subject Keywords.
    • Price (at least one required): Price in dollars. Example: 19.95 or 495. You can create multiple price fields if you want to have different pricing structures for different customers. All the price fields must be in sequence with no other types of fields between them. You'll also need to set the CUSPRC parameter. See "To calculate discounts, sales tax, and shipping and handling:" for details on using multiple price fields.
    • Checkbox field (optional): You can add a field that stores Yes/No values for each product as a series of 0's and 1's in a single field. A "0" means "no" and a "1" means "yes". You have no more that one checkbox field in itmfil.asc. This field can contain any number of 0's and 1's.

      For example, you could have checkboxes for "New items", "Sale items", and "Sound clip available". A value of 101 in the field would mean the item is new and there is a sound clip available as a link for this item.

    • Additional key or description fields (optional): You can add other fields or category fields to help customers search for the products they want. (Step 3 in the procedure that follows shows how to set up category lists to make searching easier.)
    • URL field (optional): You can include a field that contains the URL you want this item to be linked to in the order form.
    • Taxable field (optional): This field should contain a "1" (one) if the item is subject to sales tax and a "0" (zero) if the item is non-taxable. See "To calculate discounts, sales tax, and shipping and handling:" for details on computing sales tax on an order.

You can combine several pieces of information in a description field to "extend" the amount of information you can display in the order form (which is limited to 5 fields). For example, you may want to combine a Title and Author in a Description field.

If you combine fields this way, you may also want to include the information in separate fields to allow customers to search individual fields. For example, you might create "Title", "Author", and "Title / Author" fields. Customers could search the "Title" and "Author" fields, and the order form could display the "Title / Author" field.

--------------------------
--> To customize your search form layout:

  1. There are two basic search form formats: The "freeform search" and the "formatted search".
    • Freeform search: Lets customers search for occurrences of the text they type in any field in itmfil.asc. To use the freeform search, set the SRCH1 and SRCH2 parameters in ./dwos/data/store-abbrev/params.sh to sample values customers might want to search for. NetStores lets customers decide whether they want to find records that match either at least one ("or" match) or both ("and" match) of the search strings.
    • Formatted search: Lets customers search the fields in itmfil.asc you specify. Also lets you provide lists of valid values for fields. To use formatted search, set the following parameters in ./dwos/data/store-abbrev/params.sh to control how fields in itmfil.asc are used in the search form:
      • SRCHTXT: Set this parameter to some HTML code that provides instructions for using the search form. The default SRCHTXT is "<h3>Enter keywords to search our catalog or leave fields blank for all.</h3>".
      • SRCHS: Set this parameter to the list of field names you want to use in your form and the corresponding field numbers in your itmfil.asc. Put the field names in the order you want them to appear in your form. Don't use spaces, quotation marks, <, >, =, &, |, or # in any field names.

        The general format should look like this:

            "fldname_1=fld_#|fldname_2=fld_#|fldname_n=fld_#"
                 

        Fields in itmfil.asc are numbered beginning with 1. Separate fields with the pipe ("|") character. For example, the previous form uses this definition for SRCHS: "Item#=1|Artist=3|Title=4|Label=7|Category=2|Config=6" A book catalog might use the following SRCHS definition:

            "ISBN=1|Author=2|Title=3|Subject=6|Publisher=4"
                 
      • ANYLIT: Set this parameter to the text you want to use for the option in a category list that matches all records. The default text is "Any". For example, you might want to set this parameter to "All" as was done for the form in the previous picture.
      • CHKFLD: If you have a checkbox field in itemfil.asc, set this parameter to the field number of that field. For example, set this parameter to 8 if your record format looks like this:
            item_#|category|artist|title|price|media|label|checkfields|
      • CHKBOXS: Set this parameter to the field names you want to use for the checkboxes in the search form. Separate the fields names with the pipe ("|") character. The number of field names must match the number of digits in your checkbox field in itemfil.asc. For example, "This Weeks New Arrivals|Upcoming New Releases".

        If a customer checks multiple boxes, only records that have 1's in all the checked fields will be listed. (It's an "and" search, not an "or" search.) An unchecked field matches records with either a 0 or 1.

  2. NetStores automatically adds the following fields to the search form:
    • Sort by: (formatted search only) This fields lets customers choose to sort the list of matching products by any of the fields in the SRCHS parameter.
    • Search on UPPER case only: If this box is checked (the default), searches are case-insensitive. If the customer unchecks this box, searches strings must match the case of the records in itmfil.asc.
    • Limit to # items selected: This field lets customers decide the maximum number of items they want listed. They can choose 10, 25, 50, 75, 100, or 125.
  3. If you are using the "formatted search" form and have fields with a fixed set of values (such as Product Category or Manufacturer), create a list file called fldname.lst where fldname is the name for this field in the SRCHS parameter definition. (The file extension is lowercase LST for "list", not one-st for "first".) For example, if your SRCHS definition is:
        "Item#=1|Artist=3|Title=4|Label=7|Category=2|Config=6"
       

    you might have list files named Label.lst, Category.lis, and Config.lst. Each list file should contain the valid values for this field in the order you want them listed in the field. Put one value on each line of the file. For example:

        Hardback
        Paperback
        Oversize book
       

--------------------------
--> To customize the "look" of your store:

  1. The storefront uses the CNAME, BBGD, LOGO, and MODE parameters, which are described in the section on "Setting basic store parameters".
  2. You can create a file called ./dwos/data/store-abbrev/help1.html that contains help about how to use your online store. A link to this page that says "Click here for NetStores Wizard!" will appear on your storefront page. If you do not create this page, the link will go to the mall-wide help page.
  3. You can create a file called srchmsg that contains HTML code to describe your store and its products. This file will be inserted below your logo and above the search form. For example, you can provide a description of the types of merchandise your store sells.
  4. Set the following parameter in ./dwos/data/store-abbrev/params.sh to control how your storefront links to any other Web site you have:
    • SRCHURL: Set this parameter to the URL you want your store logo to link to. If your store has a Web page or site with general information about your store, you can use this parameter to link to it. For example, "http://www.myaddress.com/info.htm".
  5. Set the following parameters in ./dwos/data/store-abbrev/params.sh to control how your storefront prompts for an account number:
    • CUSLIT: Set this parameter to the name of your store if you want customers to open store-level accounts. Set it to the name of the mall if you want customers to open mall-level accounts.
    • LEVEL: Set this parameter to "dist" (for "distributor") if you want to require customers to provide an account number and password before they can search your product list. Wholesale distributors may only want to allow customers with accounts to search the product list. Retail merchants probably want few barriers to casual browsing. If you do not define LEVEL, customers will be able to provide an account number later when they want to add an item to their order.
    • ALWCUS: If LEVEL is "dist" and ALWCUS is "Y", the Search Form contains a link to open an account. If LEVEL is anything other than "dist", the Order Form contains a link to open a new account. By default, customer accounts are shared by all stores in the mall. See "Creating account and transaction files" for details on setting up store-level customer accounts.

--------------------------
--> To customize your order form layout:

The order form (which presents the results of the search) and the order acceptance form (which shows the current order total), can contain up to five fields from itmfil.asc. NetStores lets you set the parameters shown here to control the format of the table in the order form and the order acceptance form:

  1. Set the following parameters in ./dwos/data/store-abbrev/params.sh to control the layout of the order form:
    • TOPMSG: Set this parameter to the HTML code you want NetStores to include in the order form just below the image defined by the LOGO parameter.
    • ACCTLOC: Set this parameter to "bottom" if you want the fields for entering an account number and password to be at the bottom of the order form. Otherwise, the fields will be at the top of the form (below the LOGO and the TOPMSG).
    • QTYSTYLE: Set this parameter to:
      • 0 (zero) if you want the Quantity field to be a text field.
      • 1 if you want it to be a checkbox. Use a checkbox if customers can only order one of each item.
      • 2 if you want it to be a pull-down list. Set the QTYVALUS parameter too if you want to use a pull-down list.
    • QTYSIZE: If you set QTYSTYLE to 0, set this parameter to the number of digits you want customers to be able to type in the Quantity field.
    • QTYVALUS: If you set QTYSTYLE to 2, set this parameter to a comma-separated list of the quantities you want customers to be able to choose from.
    • INOFLD and INO2FLD: Set these parameters to the field numbers in itmfil.asc that make up the unique key for each record. You don't need to define INO2FLD if your unique key requires only one field.
    • INOLEN, INO2LEN: Set these parameters to the number of letters you want to limit each key field to if a customer is using a browser that may not support tables.
    • KEYFLDS: Set this parameter to a comma-separated list of the field numbers that make up the unique key. If the unique key is made up of only one field and that field is the first field in itmfil.asc, you don't need to set this parameter.
    • DATFLD: If INOFLD (the first field of the unique key) is a date with the YYNNDD format (961231), set this parameter to the field number in itmfil.asc that contains this date. NetStores will reformat the date in the NN/DD/YY format (12/31/96).
    • DSC1FLD, DSC2FLD: Set these parameters to field numbers in itmfil.asc that contain descriptions for each item. These fields will be included in the order form and order acceptance form.
    • DSC1LEN, DSC2LEN: Set these parameters to the number of letters you want to limit each description field to when a customer is using a browser that may not support tables.
    • IPRCFLD: Set this parameter to the field number in itmfil.asc that contains the price of each item. This field will be included in the order form and order acceptance form. If you want to have different price lists for different customers, you can create a series of price fields and set IPRCFLD to the number of the first price field in itmfil.asc. You'll also need to set the CUSPRC parameter. See "To calculate discounts, sales tax, and shipping and handling:" for more details.
    • OBJFLD: You can set this parameter to a field number in itmfil.asc that contains a URL to link to for this product. Another way to have NetStores automatically add links for products is to use the objects directory as described in "Customizing the "look" of the store".
    • DISURL: Set this parameter to "Y" if you do not want NetStores to check the ./objects directory for HTML or image files to be linked to the items listed in the order form. See "Customizing the "look" of the store" for details.
    • SUBMSG: Set this parameter to the text you want to use in the button customers click to add items to an order. For example, "Add Items to Order".

NetStores Administrator's Guide

1: About NetStores
2: Installing and Using NetStores

3: Troubleshooting
4: Technical Reference

[ Previous ][ Contents ][ Chapter TOC ][ Index/Search ][ Next ]
Copyright © 1996 NetStores