4. Modify the iVend templates using standard HTML, RXML and additional 
IVML (iVend markup language) tags. A listing of IVML tags can be found in 
the section labelled IVML. The minimum files required by ivend to operate 
must be present in each store's data directory and are described below:

index.html -- the default page displayed upon arrival at the store.
groups.html -- this page is used to display all available store groups.
group_template.html -- template used to generate group listings.
product_template.html -- template used to generate individual product listings.
cart.ivml -- handles shopping cart functions.
error.html -- custom error message for iVend errors (optional).

examples of these files are located in the examples directory.


IVML

The following tags are additions or modifications of existing HTML and 
RXML tags. They are only available within the iVend system. Please note
that checkout tags are discussed in a separate section, as they are
independent of the main iVend engine.

<ivml></ivml>  the grand daddy of the tags. surround all of your pages
that are served by ivend with these tags, otherwise the following tags
won't work. use in place of <html></html>.

<a></a> has been modified to provide session tracking capabilities. 
Additionally, the following attributes have been added:

  cart: generates a link to the store's shopping cart page.
  groups: generates a link to the store's group listing page.
  checkout: generates a link to the store's checkout page.

<ivstatus> when used on product pages, this tag will display information about
additions to a user's shopping cart, and possibly other information from 
the iVend system.

<ivmg> is used to insert an image from a product or group stored in ivend's
database. This tag takes the following attributes:

  field: indicates the field that contains the image you want to display.

<icart></icart> displays the store shopping cart for the current
sessionid. This tag takes the following attributes:

  fields: a comma separated list of fields to include in the cart.

<form></form> has been modified to automatically handle session tracking.

<listitems> generates a table of products which fall in a particular
group. The following attributes affect this tag:

  fields: a comma separated list of fields to include in the table.
  names: a comma separated list of alternate names for fields included in
     the table.

<category_output></category_output> will repeat the contents the container
once for each record found, replacing values of each field where instances
of the fieldname are surrounded by #s. Similar to formoutput in rxml. This
container takes the following attributes:

  type=products|groups: required. selects what type of records to select.
  restriction=restriction: optional restriction on selection. example:
    restriction="manufacturer='kodak'" must follow sql format rules.
  random: optional, when used with formrotate, the template to be used 
    will be chosen at random from those provided.

<formrotate></formrotate> is used within the category_output container. it
provides multiple templates to rotate through while processing records. if
you provide 2 formrotate containers, every odd record will be processed
using the contents of the first container and every even record will be
processed using the second container as the template.



Email Notification
------------------

Automatic email messages are sent by iVend following certain events. iVend
checks the notes directory of your store for the presence of text files.
Here is a list of the text files that iVend looks for:

notify.txt: sent to the store administrator when a new order is confirmed.

These messages are sent to the individual who places an order:

confirm.txt: sent after confirmation of a new order.
rejpay.txt: sent when payment information is rejected.
ship.txt: sent when all or part of an order is shipped.

Checkout Tags
-------------

the subtotal is the sum of all taxable and nontaxable items ( including
shipping if taxable ). discounts and salestax are calculated from the
subtotal. All checkout tags function within the checkout container,
<checkout></checkout>.

generate_form		generate a form from the database
  table=tablename	this is the table to get data for.
  hide=field1,field2    hide these fields in the list.

confirmemail
  field=fieldname	name of field containing email address to check.

salestax		added as a lineitem
  locality=fieldname	name of field in billing address to determine
			taxrate.

discount
  percent=percentage	percent discount of subtotal, which is then
			removed from the subtotal.
grandtotal
			sum of all lineitems

showorder		show all items in this order.

shipping		show the shipping charges

shippingtype		show the shipping type

addentry		add the data from the previous form.
  encrypt=field1,field2..  encrypt these fields using rsa.
  noflush		don't remove preixisting db records
			useful when table key is not unique.

cardcheck		check credit card number
  cardnumber=field	use this field name for card number
  cardtype=field	use this field name for card type (AMEX,VISA,etc)
  expdate=field		use this field name for expiration date

Other Stuff
-----------

The database schema to use currently is located in examples/schema.mysql

If the form generator finds an enum type (must be using patched mysql for
this), it will look for values in a file called 
	storeroot/db/tablename_fieldname.val ...

The iVend Main Index
--------------------

If you place a file called index.html in the iVend data directory (as
specified in the roxen config interface), and change "CreateIndex" to yes
in iVend's global variables, that file will be returned upon an access to
the ivend root mountpoint (such as /ivend/). This is useful for providing
a list of lists for all stores provided by a particular module. 

To aid in the generation of a list of lists, a special container called
<ivindex></ivindex> is available in this page. It works much like the 
formoutput container in that field names from store configurations that
are surrounded by #s like this: #name# will be replaced with that store's
value. For a better example, see the file data/index.html.




SOME NOTES ABOUT MYSQL AND SETTING UP A DATABASE
_________________________________________________________________________

Step #1 ... Make sure mysql is installed and running on your server before 
you compile and install roxen and pike.  Also make sure you have the full 
Crypto version of Roxen and GMP installed. 

Step #2 ... Changing root's mysql password for security reasons enter mysql
with this command:

mysql mysql

Than enter this at the mysql prompt, change rootpass to whatever you want 
roots password to be, make sure your logged in as root when doing all this. 
(adjust as necessary):

update user set password=password('rootpass') where user='root';

Of coursse now you have to type mysql mysql --password=rootpass

Step #2 ...  Creating the store's database, its a good idea to name dbname
something relavant to the store's hostname like "wizstoredb" or something
similar that you can remember it being a db .. wizstoredb = whatever you
want it to be named .. you can use something like funkdb  or thetstoredatabase:

mysqladmin create wizstoredb

Step #3 ... Create a database admin for the store's database, enter the mysql 
with:

mysql mysql --password=rootpass

Now type this while in the session:

insert into user (host,user,password) values('localhost','wizstoreadmin',password('wizpass'));

(Notice the user is a name relevant to the storesdb for easy remembering
and wizpass = the password you chose for that user)

Step #4 ... Now finally set the access rights for the db user you just 
created so he has complete access to edit/modify that wizstoredb sql
data.  Notice that the values of the localhost and the stores database
name and the than WHO gets the rights to it.  6 'yes's means the user
wizstoreadmin gets FULL complete rights to edit/add modify those records:

insert into db values('localhost','wizstoredb','wizstoreadmin','Y','Y','Y','Y','Y','Y');

Now type quit, to exit the mysql:

quit

Step #5 ... Go ahead and test it buddy! Enter at the prompt:

mysqladmin reload --password=rootpass

Than enter a session: 

mysql -u htmlwizadmin -p wizstore

(Enter your password next and yer in as a user!@)




Now go setup your shop by running the create_store.sh script

cd /usr/local/roxen/server/ivend/scripts
sh ./create_store.sh

