***************************************************
SHOPPING CART
Order Form v1.2 March 1998
RGA@IO.COM
http://www.io.com/~rga
***************************************************
CURRENT COPY OF READ ME
This Read Me file is under construction
THIS VERSION HAS THE NEW MEXICO INCLUDE TAX VALIDATION / COMPUTATION
ROUTINES.
YOU CAN CHANGE THE -- INCLUDE TAX FOR THIS STATE --- VALIDATION ROUTINES
AND ALL THE SCRIPTS WILL WORK FOR ANY NEW DEFINITION
THE VALIDATION SECTION (Only in <order_form_v12.pl> ) simply
returns a value of 1 if a pattern matches
Then the $include_tax variable (equals 1 if pattern is matched)
send continuing hidden variables to the other scripts
the hidden variable name is <$FORM{'includetax'}>
and this determines if tax is included or not in the remaining scripts.
Remember: Just change the pattern matching in the first script to change
any
State matching patterns for including tax or not.
DESCRIPTION OF THE APPLICATION
============================
Order Form v1.1 is a very smart online order form and invoice system for
small product collections.
It interacts mucho smartly with the user, and presents smart feedback.
It does not submit automated merchant billing via merchant accounts
through a bank for credit card purchases.
It emails the merchant with purchase invoices, and keeps a log of
purchases
It is convienient for small collections of products, since you only need
to add new items to the HTML form INPUT tags.
Any new "Checkbox" INPUT added to the initial HTML form which
uses the < .. NAME'"order" .. > will be automatically
read and processed by the script. It will handle as many New < ..
NAME="order" ..> checkboxes as you have the
time to put in your HTML form. It will probably handle as many New
Products as your server has menory; however,
this would not seem practical since the customer doesn't want to go
through hundreds of checkboxes to order items.
So, it's probably more applicable to smaller collections of products,
whereas, a database system seems more user
friendly for large product collections Did I say it was very smart ?
ADDING NEW PRODUCTS TO THE HTML FILE
=============================
IMPORTANT: About adding new < .. NAME="order" .. >
values for the HTML file to parse:
While the example HTML order form (orderform.html) has a feature to show
a pop up window with
a picture of the item, you don't have to include this in your
application, nor do you have to include any other
attributes like font, etc. that you see in the example.
You MUST however add new <IINPUT NAME and VALUE attributes>
EXACTLY as described below, else the script
cannot process the new items uniformly.
Here's how to add new checkboxes and input data to your HTML order form
<input type="checkbox" check="off" name="order"
value="Item Name----Description of the Item----11.65">
This tag will create a new checkbox that when checked by the user will
send the Item Name, Item Description , and Price
to the CGI processing files. The processing files will identify only the
"order" NAME for processing product data, and
the VALUE data will be extracted correctly only if the delimiters are
used correctly.
If you get errors from the invoice processing you better check this
portion very carefully and make sure that the NAME and
VALUE delimeters are correct. The delimiter "----" 4 minus
signs together with no spaces between text must be correct, and
you must include all 3 pieces of information in correct sequence for the
VALUE.
NAME="order"
VALUE="Item Name----Item Description----Price"
The Price must be in 2 decimil format "100.00" and it must be
a raw number with no dollar sign, etc.
All three pieces of information must be included for the VALUE input
Note: you can display anything you want in the HTML order form
associated with the <FORM INPUT ..> checkbox
function, but the actual INPUT parsed must be exactly as above. You don't
have to stick to the format
in the example (orderform.html) for displaying text associated with the
checkbox. You can display an image,
or any other text, or just display an Item name without the description
or price, but the actual INPUT parsed must
have all 3 pieces to the VALUE and must have "order" as the
NAME.
CONFIGURATION OPTIONS
=======================
You can place an image file HTML tag in the $site_name and the image
file will be displayed instead of a text name.
Or you can place both text and HTML image file tags here. Make sure you
write the full image file path
and put the ever annoying escape character before any quotation marks.
Example: Displays text followed by image
$site_name = "Art Taos <img src=\"/Documents/orderform/smiley.gif\"
border=0 width=15 height=15>";
Example: Displays just the image
$site_name = "<img src=\"/Documents/orderform/smiley.gif\"
border=0 width=15 height=15>";
PREVENTING ZEROED OUT QUANTITY FIELDS FROM PRINTING OR TOTALING IN THE
FINAL INVOICE
=============================
To prevent PRINTING the item on the final invoice:
The validation rule prevents a print of any quantity field without an
integer above zero
This works for any character, special characters, etc.
because they cause a zero value to the $value when parsed
This works because the operator is a numerical operator seeking a
numerical comparison
Other characters create a zero value
if $quantity = A, then "A" does exactly equal numerical zero !
unless ($quantity == 0) {
print the
}
To prevent TOTAL price computations on the final invoice for zeroed out
itmes
($Quantity * $Price) is is calculated based on the same rules as for
preventing printing of zero items.
if quantity is unchanged in the Qnty input then it equals 1, and the
$price for each is added to Total
if quantity is an integer > 1, then it has been changed, and ($quantity
* $price) is added to the Total
if quantity has been changed, but is not an integer, the the numerical
value of $quantity == 0,
and ($quantity * $price) = zero, and zero is added to the Total
I still haven't eliminated the use of fractions entered into the
quantity fields.
On the "Select Quantities" page.
FILES CONTAINED IN THE PACKAGE
===============================
Files contained in the ZIP file
<orderform12.html>
<order_form_v12.pl>
<order_count_v12.pl>
<order_final_v12.pl>
<order_log_v12.dat>
<order_number_v12.dat>
<show1.html> to <show9.html>
HERE'S HOW TO MAKE IT WORK
================================
There is one HTML file to start form ordering
<orderform.html>
Configure the FORM POST tag to point to your CGI-BIN
The script adjusts to INPUT items added only for the NAME="order"
in this file
You MUST follow the standard referenced at the beginning of
<orderform12.html> in comments
in order for the script to parse new information correctly
There are Show Picture HTML file windows attached to each INPUT item in
<orderform12.html>
<show1.html> .. <show9.html>
There are three CGI script files that run the Order Form v1.2
Change the extension from *.pl to *.cgi if your server requires this.
<order_form_v12.cgi>
<order_count_v12.cgi>
<order_final_v12.cgi>
Place these in your CGI-BIN
CHMOD 755 <file_name.cgi> to each one
Adjust the configurations in each of these CGI files to your server and
merchant information, etc.
See the comments at the top of these files
There are two DATA files used by the scripts
<order_log_v12.dat>
<order_number_v12.dat>
Configure <order_final_v12.cgi> settings to point to the location
of these files
Use an absolute pathway - real server location
CHMOD 777 <file_name_v12.dat> to both the DATA files
c=\"/Documents/orderform/smiley.gif\" border=0 width=15 height=15>";
Example: Displays just the image
$site_name = "<img src=\"/Documents/orderform/smiley.gif\"
border=0 width=15 height=15>";
PREVENTING ZEROED OUT QUANTITY FIELDS FROM PRINTING OR TOTALING IN THE
FINAL INVOICE
=============================
To prevent PRINTING the item on the final invoice:
The validation rule prevents a print of any quantity field without an
integer above zero
This works for any character, special characters, etc.
because they cause a zero value to the $value when parsed
This works because the operator is a numerical operator seeking a
numerical comparison
Other characters create a zero value
if $quantity = A, then "A" does exactly equal numerical zero !
unless ($quantity == 0) {
print the
}
To prevent TOTAL price computations on the final invoice for zeroed out
itmes
($Quantity * $Price) is is calculated based on the same rules as for
preventing printing of zero items.
if quantity is unchanged in the Qnty input then it equals 1, and the
$price for each is added to Total
if quantity is an integer > 1, then it has been changed, and ($quantity
* $price) is added to the Total
if quantity has been changed, but is not an integer, the the numerical
value of $quantity == 0,
and ($quantity * $price) = zero, and zero is added to the Total
I still haven't eliminated the use of fractions entered into the
quantity fields.
On the "Select Quantities" page.
FILES CONTAINED IN THE PACKAGE
===============================
Files contained in the ZIP file
<orderform12.html>
<order_form_v12.pl>
<order_count_v12.pl>
<order_final_v12.pl>
<order_log_v12.dat>
<order_number_v12.dat>
<show1.html> to <show9.html>
HERE'S HOW TO MAKE IT WORK
================================
There is one HTML file to start form ordering
<orderform.html>
Configure the FORM POST tag to point to your CGI-BIN
The script adjusts to INPUT items added only for the NAME="order"
in this file
You MUST follow the standard referenced at the beginning of
<orderform12.html> in comments
in order for the script to parse new information correctly
There are Show Picture HTML file windows attached to each INPUT item in
<orderform12.html>
<show1.html> .. <show9.html>
There are three CGI script files that run the Order Form v1.2
Change the extension from *.pl to *.cgi if your server requires this.
<order_form_v12.cgi>
<order_count_v12.cgi>
<order_final_v12.cgi>
Place these in your CGI-BIN
CHMOD 755 <file_name.cgi> to each one
Adjust the configurations in each of these CGI files to your server and
merchant information, etc.
See the comments at the top of these files
There are two DATA files used by the scripts
<order_log_v12.dat>
<order_number_v12.dat>
Configure <order_final_v12.cgi> settings to point to the location
of these files
Use an absolute pathway - real server location
CHMOD 777 <file_name_v12.dat> to both the DATA files