Dansie Shopping Cart
Template.html
Creating HTML forms
(How to put purchase buttons on your web pages)
1 Standard HTML templates for sending an item to the
shopping cart:
Back to top.A simple form:
Make sure to change the ACTION attribute in the FORM tag of this form to match the full URL to where your cart.pl script is located. It needs to match Host Variable #1 in your vars.dat file exactly.
This HTML form...
<FORM METHOD=POST ACTION="http://ssl.securesites.com/cart.pl"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=radcohomes> <B> Black Leather purse with leather straps<BR> Price: $20.00<BR> </B> <INPUT TYPE=HIDDEN NAME=name VALUE="Black Leather Purse"> <INPUT TYPE=HIDDEN NAME=price VALUE="20.00"> <INPUT TYPE=HIDDEN NAME=sh VALUE="1"> <INPUT TYPE=HIDDEN NAME=img VALUE="purse.jpg"> <INPUT TYPE=HIDDEN NAME=return VALUE="http://www.dansie.net/demo.html"> <INPUT TYPE=HIDDEN NAME=custom1 VALUE="Black Leather purse with leather straps"> <INPUT TYPE=SUBMIT NAME="add" VALUE="Put in Shopping Cart"> </FORM>
Makes this...
A very comprehensive form:
This HTML form...
<FORM METHOD=POST ACTION="http://ssl.securesites.com/cart.pl"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=radcohomes> <B> Mens Tie<BR> Price: $40.00<BR> </B> <INPUT TYPE=HIDDEN NAME=name VALUE="Mens Tie"> <INPUT TYPE=HIDDEN NAME=price VALUE="40.00"> <INPUT TYPE=HIDDEN NAME=sh VALUE="1"> <INPUT TYPE=HIDDEN NAME=img VALUE="mens_tie.jpg"> <INPUT TYPE=HIDDEN NAME=return VALUE="http://www.dansie.net/demo.html"> Size: <SELECT NAME=custom1 SIZE=1> <OPTION>Small $40.00 <OPTION>Large $50.00 </SELECT><BR> Color: <SELECT NAME=custom2 SIZE=1> <OPTION>Grey <OPTION>Blue <OPTION>Purple <OPTION>Polka Dot </SELECT><BR> With tie clip? <SELECT NAME=custom3 SIZE=1> <OPTION>No clip <OPTION>Clip +$10.00 </SELECT><BR> Quantity: <INPUT TYPE=TEXT NAME=quantity VALUE="1" SIZE=2 MAXLENGTH=2><BR> <INPUT TYPE=SUBMIT NAME="add" VALUE="Order"> </FORM> |
Makes this...
Back to top.
"merchant" required in ALL YOUR
HTML FORMS!
"ACTION" in the <FORM> tag above must be used in all forms. Set the
ACTION URL to the URL where your cart script is located.
"name" in the <INPUT TYPE=HIDDEN> tag above must be used in all
forms. Set the name to whatever you want.
"price" in the <INPUT TYPE=HIDDEN> tag above, likewise, must be
used in all forms. Set the price to whatever you want.
Volume Discount Pricing method.
You may utilized the Dansie Shopping Cart's volume discount pricing capabilities. Just set the value of this tag like so:
<INPUT TYPE=HIDDEN NAME=price VALUE="3.00:1:2.50:10:2.00:20">
Explanation:
$3.00 for 1 or more.
$2.50 for 10 or more.
$2.00 for 20 or more.
Etc... Use the colon ":" for the delimiter.
The Dansie Shopping Cart has two other discount features: Webstore Discount and Coupon Discount. See Personal Variables #52 and #59 in the ReadMe.
"sh" in the <INPUT TYPE=HIDDEN> tag above stands for Shipping
and Handling. You only need to use this tag if you have Personal Variable #27 set to
"1" (using shipping calculated by the weight of each item method). See the
ReadMe for details on Personal Variable #27. Set this to how many pounds/kilos that this
item weighs.
"img" in the <INPUT TYPE=HIDDEN> tag above stands for
"image". The use of this tag is optional. If you would like a thumb-nail image
of this item to appear in the cart, then set the value of this tag to the full URL of the
image you want to use. You may also put just the image name and the cart script will use
the "images directory" that you specified in Host Variable #3 as its location.
You may make the width and height of your thumb-nail images uniform with the help of
Database Variable #18.
"return" in the <INPUT TYPE=HIDDEN> tag above is optional. If you
wish to specify what page your customer returns to when they click the "Continue
Shopping" button at the bottom of the cart display, then set the value of this tag to
the full URL of the page you want them to return to. If you don't use this tag in your
forms, then the URL your customers will "Continue Shopping" at will be the
"default return shopping URL" that you specified in Host Variable #2.
"quantity" in the <INPUT TYPE=TEXT> tag above is optional. If you
wish to allow your customers to choose their quantity then you can use this tag. If you
don't use this tag, the cart will use a default quantity of 1. Your cart gives you the
ability to change quantity later after the item is in the cart too.
"custom1" (the name of the "size" <SELECT> pull-down menu
above) has the ability to actually change the price of the item. This is done with the use
of your currency symbol (Personal Variable #36) followed by a numeric value at the end of
the <OPTION> tag.
"custom2" (the name of the "color" <SELECT> pull-down
menu above) has the ability to send a custom description to the shopping cart with this
item, but not change the price of the item because the currency symbol is not in the tag.
"custom3" (the name of the "With tie clip?" <SELECT>
pull-down menu above) has the ability to actually add to the price of the item. This is
done with the use of the plus sign (+) followed by your currency symbol (Personal Variable
#36) followed by a numeric value at the end of the <OPTION> tag.
"custom100" You may use as many custom descriptions that you want in your
forms. Just make sure you set Personal Variable #1 in your "vars.dat" file to
the highest number of "customs" that your cart will use in any given HTML form.
The default is set at 20.
"merchant" For use with the Mall Version. See the
Mall Version section of the ReadMe for details.
"redirect" This works with the "Add and Redirect" feature. See
Personal Variable #49 in the ReadMe. If you would like a few HTML product forms to deviate
from the default settings that you put in PV#49, then you can use this tag in your HTML
forms:
<INPUT TYPE=HIDDEN NAME=redirect VALUE="1">
or
<INPUT TYPE=HIDDEN NAME=redirect VALUE="2">
"#nontaxable#" If you have the cart set to calculate sales tax (see
Personal Variable #12) but you don't want sales tax calculated on one item, then use a tag
like so:
<INPUT TYPE=HIDDEN NAME="custom1" VALUE="#nontaxable#">
"#noshipping#" If you have the cart set to calculate shipping according
to the subtotal (see section 10 in the ReadMe. This is when you have Personal Variable #27 set to 2.) but you
don't want shipping considered on one item, then use a tag like so:
<INPUT TYPE=HIDDEN NAME="custom1" VALUE="#noshipping#">
Back to top.
Examples:
<INPUT TYPE=CHECKBOX NAME="custom1" VALUE="With tie clip? +$10.00"> <INPUT TYPE=RADIO NAME="custom2" VALUE="No tie clip"> <INPUT TYPE=RADIO NAME="custom2" VALUE="With tie clip +$10.00"> What initials would you like embroidered into your tie? <INPUT TYPE=TEXT NAME="custom3" SIZE=20 MAXLENGTH=20> What initials would you like embroidered into your tie? <TEXTAREA NAME="custom4" COLS=30 ROWS=3></TEXTAREA> You may use standard submit buttons or images like so: Standard submit button: <INPUT TYPE=SUBMIT NAME="add" VALUE="Put in Shopping Cart"> Custom image submit button: <INPUT TYPE=HIDDEN NAME="add" VALUE="1"> <INPUT TYPE=IMAGE SRC="http://www.YourSite.com/add.gif" NAME="Order"> |
2 Using "multi-items" HTML forms:
comprehensive capabilities with them. In other words, you can't put a bunch of pull-down menus next to each product. The way that "multi-items" forms work best is with a huge list of products with check boxes down the page that don't need any extra custom descriptions.Want to send multiple items to the shopping cart at one time with the use of checkboxes? Make sure you set the "name" tag to "multi-items". For each item, use "multi-item1", "multi-item2", etc. The value of each multi-item is four or more fields separated by the "|" delimiter. The key to the fields are as follows:
name|price|shipping|image|custom1|custom2|custom3|etc.
You may use a quantity text box with each multi-item. Just give it a corresponding number such as "quantity1", "quantity2", etc. If you omit the quantity text box, a default value of one will be given. Be sure to set Personal Variable #1 to the number of the largest number of multiple items you have in a form. For example, if you have a form that has 50 multiple items in it, set Personal Variable #1 to 50. The cart script wont look for any items higher than that array.
"multi-items" HTML form limitations:
If you use "multi-items" forms, then you can't use any
This HTML form...
<FORM METHOD=POST ACTION="http://ssl.securesites.com/cart.pl"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=radcohomes> Item: Quantity:<BR> <INPUT TYPE=HIDDEN NAME="name" VALUE="multi-items"> <INPUT TYPE=HIDDEN NAME="return" VALUE="http://www.dansie.net/demo.html"> <INPUT TYPE=CHECKBOX NAME="multi-item1" VALUE="Banana Split|3.95|1|split.jpg|A delicious ice cream treat."> Banana Split<INPUT TYPE=TEXT NAME="quantity1" VALUE="1" SIZE=2 MAXLENGTH=2><BR> <INPUT TYPE=CHECKBOX NAME="multi-item2" VALUE="Pineapple|2|1|pineapple.jpg|A juicy pineapple."> Pineapple<INPUT TYPE=TEXT NAME="quantity2" VALUE="1" SIZE=2 MAXLENGTH=2><BR> <INPUT TYPE=CHECKBOX NAME="multi-item3" VALUE="Watermelon|3|1|watermelon.jpg|A ripe watermelon."> Watermelon<INPUT TYPE=TEXT NAME="quantity3" VALUE="1" SIZE=2 MAXLENGTH=2><BR> <INPUT TYPE=SUBMIT NAME="add" VALUE="Put these in my cart!"> </FORM> |
Makes this...
3 HTML that allows customers to "view cart
contents" or "checkout":
This is the HTML you use to display an image link that allows customers to "look" into their cart, or finish their purchase. Make sure you set the FORM ACTION to the correct URL. Also, set the proper URL to the cart.gif. It is recommended to have this image link on every page of your website. If your website uses frames, it is recommended to have it in your toolbar frame and use TARGET.
Example #1 (a link) <A HREF="http://ssl.securesites.com/cart.pl?look|radcohomes"> <IMG SRC="cart.gif" BORDER=0 ALT="View Your Shopping Cart"></A> Example #2 (a form) <FORM METHOD=POST ACTION="http://ssl.securesites.com/cart.pl"> <INPUT TYPE=HIDDEN NAME=return VALUE="http://www.DOMAIN.COM/SuperWuper.html"> <INPUT TYPE=HIDDEN NAME=purpose VALUE="look"> <INPUT TYPE=HIDDEN NAME=merchant VALUE=radcohomes> <INPUT TYPE=IMAGE SRC="cart.gif" NAME="View Cart/Checkout" BORDER=0> </FORM> |
Mall Version Notes
If you are using the Dansie Shopping Cart Mall Version, when using Example #1 above, you will need to link to the cart like so:
http://www.radcohomes.net/cgi-bin/cart.pl?look|merchantNameHere
First put "?", then "look", then "|", then the merchant's name.
Your example: http://ssl.securesites.com/cart.pl?look|radcohomes
With the Dansie Shopping Cart Mall Version, when using Example #2 above, just be sure to include this tag like you do in your HTML product forms:
<INPUT TYPE=HIDDEN NAME=merchant VALUE="radcohomes">
4 Using the Dansie Shopping Cart search engine with
flat-file databases:
lang.dat file. If you wish to use the 3.0 search engine, then set Database Variable #25 in your vars.dat file to "3.0". If you want to remain with the old 2.0 search format, then just leave DBV#25 blank or set it to "2.0".Dansie Shopping Cart version 3.0 has been upraded with new powerful search features. Make sure you add Database Variable #25 and #26 to your vars.dat file to take advantage of these new powerful features. Also, make sure you have lang.dat #91 through 96 and 149 and 150 from the 3.0
Makes this...
6 Adding items to your cart with a link as opposed to a
submit button:
section 1 and 2 of Template.html or you may use the GET method too by passing the name/value pairs to the cart.pl script in a query string.You may add items to your cart with <FORM> tags and submit buttons as you see in