Simple Cart - FAQ


How to install the cart on your server?

First, you need to change the first line of
the shopit.cgi file to reflect the location of
perl version 5 on your server:

#!/usr/bin/perl5

Be sure to leave the #! in front of the full path
to perl5.

Remember, on some servers, you need to have 
your cgi's in the cgi-bin.  You can tell if
this is the case, by installing the script in
another directory.  Then try to access the
script, if it just prints out the script
as text, then you have to have the script in the
cgi-bin.

Next, you need to be sure that the tmpdir is available
and writeable.  If you are not using /tmp, then you
need to create the directory and chmod 777 'directory name'.

You also need to chmod 755 the shopit.cgi file.

Chmod's can be done through telnet or through an
ftp client that supports it.

After that, you just need to be sure that all of the
other config settings in shopit.cfg are correct.  Older
versions have the config settings at the beginning of
the shopit.cgi file.

How to I get the order form emails to come to me?

Inside the quantityform template, search for TOEMAIL.
Change that email address to your email address.

How to add a product?

First, you need to add a line to the products.csv file.
You can edit this file through any spreadsheet program,
like Excel or Lotus.  Or you can just edit the file
with a text editor like Notepad.  Just be sure that you 
make the product ID # unique, as in no other product has 
the same ID.

Now that you have the new product in the database you need
to add a link to that item for people to purchase it.  You
can have any HTML on the page that you like describing the
product.  The link to add the item to the shopping cart is like:

<a href="url to shopping cart directory/shopit.cgi?prodid=ID#">Buy this product</a>

Where ID# is the number relating to the new product.

Then that product is all set to go!

How to adjust the shipping charges?

Inside shopit.cgi, you need to be sure that enable shipping
is set to YES.   Then you need to set the other variables:

$shipping[X]="UPS 2 day";
$shippingfile[X]="shippinginfo1.db";

where X is a number, start with one and have as many
different ones as you like.   The shipping variable contains
the type of shipping, this will appear in the selection
box on the quantity form page.  Then shippingfile is
the location of the file that holds the shipping info
for that type of shipping.

You need to edit the shipping files with a text editor
or spreadsheet program.  Here is the format:

Order Total1, Shipping charge1
Order Total2, Shipping charge2
Order Total3, Shipping charge3

Where Order Total1 is less then Order Total2...

Here are the variables that relate to shipping:

(*SHIPPING)       - The current cost of shipping 
(*SHIPPING_TYPE)  - On the quantity form template, this is a selection box.
                    On the final cost form it is just text.
(*TAXSTATE)       - The state which you have chosen in the shopit.cgi file
(*TAX_PERCENTAGE) - The percentage of tax that you have chosen
(*TAXES)          - The checkbox to indicate whether the customer wants to be taxed
(*TAX)            - The amount of tax on the current order

How to get setup for state taxing?

You need to edit the shopit.cgi file, adjust
the $tax and $state variables to meet your needs.

Then inside the template files there are commented
references to taxes.  You can use the variables
the way they are setup just by uncommentting that
section.  Or you can move the (*TAXSTATE) and (*TAX)
variables and change the text around them to meet
your needs.

How do I change the look of the template files?

File Definitions:

errorpage.template - This is just a page that is displayed
if the cart has some sort of fatal error like it can't
open a file for writing.

quantityform.template - The page of the cart where
the users can fill in their information and adjust their
order.

finalcostform.template - The page after they hit
order, it displays the order and the information
from the form.   This also should say something like:
"Thank you for your order"

The first part of the quantityform or finalcostform
template files is defining the look that each item
in the current shopping cart will have.  Everything
above '--END OF EACH ITEM DEF--' is part of this 
definition.

The variables, (*Variablename), are field names coming
from your database.   You can position them however
you like.  

Below that section, is just normal HTML.  That
is where you would adjust the look of the page,
like the background color and the look of the form...

Of course, there are some variables that can be
used in this section which you can see.  They
are self explanatory for the most part.  

STARTINFOFORM - This variable contains the FORM
html tag with the appropriate Action set.  It 
needs to be placed above any form elements including
the INSERTFORM variable.

INSERTFORM - This is where all of the items defined
in the previous section will be placed.
 
REFERER - This is the url that the customer came
from.  It would normally be used to set where
the 'CONTINUE SHOPPING' button will go.  This is
done by setting the refer variable like so:

<input type=hidden name=refer value=(*REFERER)>

Or for a static url:

<input type=hidden name=refer value=/myurl.html>

On the quantityform, you can require that a field
be filled in on the form by adding an exclamation
in front of that name.  Some are set this
way for you to see.

On the finalcostform, FIRST_NAME, LAST_NAME... are
variables from the previous page's form.  

How to turn off shipping and/or taxing?

First, you need to go inside the shop.cgi file and
change the enable_shipping variable to NO and/or the
state variable to OFF(this turns of the taxing).

Then you need to remove the lines that show the
taxing and shipping information on the quantity form,
and the final cost form templates.

How to add fields to the database?

You need to just add a new field to the middle
of the database, ID must be the first and PRICE
must be the last part of a database record.  

Then to have that field show up on the order form
pages, you need to use a variable like so: (*fieldname)

This will only work in the first section of the template
files, where you define what each item is to look like.
(i.e. before --END OF EACH ITEM DEF--)

How do I setup a regular search form (Search Module)?

Just view source on the demo search form, and cut/paste
where ever you need it.

How do I setup an advanced search form (Advanced Search Module)?

This is more complicated than a standard search since 
there are so many fields to search on.  

Here is some of the sample form(a_search.html):

<FORM method=get action=shopit.cgi>
<input type=hidden name=asearch value=1>
<input type=hidden name=search_fields value="type,tcolor,cabsize,drive,warranty,radio,transmission,engine">

The search fields tag needs to specify all searchable
fields excluding price and age.  Price and age 
are special since they don't do exact matches,
they are less than searches.  

Other than those two, to add selection boxes for 
the rest of the fields, just follow the example.  
Each option would be a choice that you have in 
your database. Oh, and each field must exist in 
the database, i.e. type,tcolor...
 

How do I use the secure module?

The secure module is fairly easy to setup
and use.  As far as install, all that is
needed is: 

chmod 777 admin/saves/ 
chmod 755 admin/forms.cgi

You should password protect the admin directory
to keep intruders out.  Most html editors
allow for this, but for a fee, we can set it
up for you with the userid and password of your
choice.

As for the operation, the main thing is
your save type.  How you want the orders
to be saved to the secure server. 
Sample from the shopit.cfg file:

# Secure save type:
# 1=individual files
# 2=one file for each day
# 3=one file for each month
# 4=one file for each day, csv database file
# If using 4, you must define the csvdefs variable below

$secure_type=2;

2 is what most use, since you can get 
a seperate file of new orders for each
day.  This eliminates trying to figure
out which orders are which.  4 is
also used a lot since you can import 
each daily file directly into a database
like Excel or Lotus.

How do I use the Dynamic Display Module?

This module allows you to have a page automatically
created for each item in your database.  This 
is generated from a template file which merely 
contains variables from your database, like 
(*PRODUCT_ID).

In addition, you can use two additional variables:
(*IMAGE) and (*LONG_DESC)

To use these you need to create a sub-dir named
image and one named descriptions.
Then inside those directories, put files named
product_id.jpg or product_id.txt, where product_id
is an actual product_id from your database.  You
can also specify default.jpg and default.txt, which
will be used if product_id.* doesn't exist.