Start with a database

### Index Up >>

## Start with a database

The first thing you must do is develop your product database. This might contain all of the information used to display pages about your products -- or just the product code (SKU), short description, and price. At the minimum, those three fields are required.

Some other things you might put in:

image
  A database field giving the name of an image file to display the product. Alternatively, you can keep images in files that are named for the product code -- then display them if they exist (use the `[if file file.gif] TAG [/if]` construct).

nontaxable
  This field should be present if you have items that do not have sales tax calculated for them.

size
  A comma-separated string containing product size information, for example:

        Small, Medium, Large, XL

  You can also define any other attribute information in a database field.

weight
  The shipping weight of an item is useful for UPS lookup or other weight-based shipping calculations.

category
  If you wish to do one-click category searches to build product directories, you might use this field to select on.

related
  Items related to the item in the record. Using MiniVend's `[loop item]` tag, you could build product subclasses and accessory sets.

By default, all database source files are located in the in the products subdirectory of the catalog directory. The main products database we discussed above is in the file `products/products.txt` in the supplied demo catalogs. If you use one of the internal database methods, then any changes that are made to the ASCII source file will be reflected in the database on the next access by a user. If you have a very large database, this may not be what you want -- it can take some time to build a large database. If you have less than a thousand records like the ones shown above in your products database, you normally need not worry -- updates will be almost instantaneous. (See NoImport if you wish to stop auto updating.)

### Index Up >>