I am using MS Front Page 2002, my server is running FrontPage server extentions, and I am creating a site for a business that sells clothing.
The Problem:
They offer about 100 items = 100 "add to carts"
Each item can have up to 6 color choices = 600 "add to carts"
Each item has 7 size choices = 4200 "add to carts"
Each of these has 4 volume amounts i.e. Each,Dozen,Lot,24 doz. = 16,800 "add to carts"
How do I have one "add to cart" for each Item # without 2 million pages of code?
I would like to use radio buttons or drop down menus to narrow down the selection but I don't know how to take that info and place it into the format that PayPal needs to add to the shopping cart. I have a seperate page for each Item #.
Ex

escription:1921 Khaki 3XLarge 1 Doz, Item #:1921, Color:Khaki, Size:3XLarge, Amount:1 doz, Price:$360.00, Shipping:$0.00, Extra shipping:$0.00, Handling charge:$0.00
OnClick="PPWindow('1921+Khaki+3XLarge+1+doz','1921 K3XLD','3 60.00','0','0','0');">
All of the variables.......
Item#
Color
Size
Amount
Price
Shipping
Extra shipping
Handling
......change for each item.
Please help!
If you could please give step-by-step instructions and explanations for I am new to coding. I am a cut and paster and FrontPage user.
Here is the code with a list of problems that correspond to the notes in the script
To see the way this looks with images goto
www.fasttrack.has.it click on ladies apperal then click on the image in the frame.
<html>
<head>
<link href = "../../std.css"
rel = "stylesheet"
media = "screen, print"
type = "text/css" />
<title>New Page 2</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<meta name="creator"
content="fasttrackemb@adelphia.net" />
<meta name="keywords"
content="javascript, script, paypal, modification, dynamic, form, select, concatenate, dropdown, tutorial, option" />
<meta name="generator"
content="Microsoft FrontPage 5.0" />
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Style 815</title>
<meta name="Microsoft Theme" content="fast-track 011, default">
</head>
<style>
<!--
td {font-family:Arial, Helvetica; font-size:12px; color:#000000;}
td.features {font-family:Arial, Helvetica; font-size:8pt; color:#000000;}
-->
</style>
</head>
<body>
<script type="text/javascript">
<!--
function Dollar (val) { // force to valid dollar amount
var str,pos,rnd=0;
if (val < .995) rnd = 1; // for old Netscape browsers
str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape
pos = str.indexOf (".");
if (pos > 0) str = str.substring (rnd, pos + 3);
return str;
}
function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val;
amt = obj1.baseamt.value*1.0; // base amount
des = obj1.basedes.value; // base description
for (i=0; i<obj1.length; i++) { // run entire form
obj = obj1.elements[i]; // a form element
if (obj.type == "select-one" && // just get selects
obj.name == "") { // must be un-named
pos = obj.selectedIndex; // which option selected
val = obj.options[pos].value; // selected value
pos = val.indexOf ("@"); // price set?
if (pos > 0) amt = val.substring (pos + 1)*1.0;
pos = val.indexOf ("+"); // price increment?
if (pos > 0) amt = amt + val.substring (pos + 1)*1.0;
pos = val.indexOf ("%"); // percent change?
if (pos > 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
if (des.length == 0) des = val;
else des = des + ", " + val; // accumulate value
}
}
obj1.item_name.value = des;
obj1.amount.value = Dollar (amt);
if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}
//-->
</script>
<table width="485" border="0">
<tr>
<td style="font-family: Arial, Helvetica; font-size: 12px; color: #000000"
width="318">
<a style="color: #3300CC; text-decoration: none" href="../Ladies.htm">Ladies Apparel</a> >
<a style="color: #3300CC; text-decoration: none"
href="../Ladies%20Template.htm">Anvil</a></td>
<td align="right"
style="font-family: Arial, Helvetica; font-size: 12px; color: #000000"
width="169"><b>
Style: 815</b></td>
</tr>
<tr>
<td colSpan="2"
style="font-family: Arial, Helvetica; font-size: 12px; color: #000000"
width="491"><table cellSpacing="0" cellPadding="3" width="483" border="0"
height="473">
<tr>
<td vAlign="top" rowSpan="2"
style="font-family: Arial, Helvetica; font-size: 12px; color: #000000"
width="300" height="467">
<img border="0" src="../images/815.jpg" width="300" height="360"><br>
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td style="font-size: 8pt; font-family: Arial, Helvetica; color: #000000"
vAlign="top" align="middle" width="60">
<img src="../../images/Ash.jpg"
border="0" width="50" height="50"><br>
Ash </td>
<td style="font-size: 8pt; font-family: Arial, Helvetica; color: #000000"
vAlign="top" align="middle" width="60">
<img src="../../images/Black.jpg" border="0" width="50" height="50"><br>
Black </td>
<td style="font-size: 8pt; font-family: Arial, Helvetica; color: #000000"
vAlign="top" align="middle" width="60">
<img src="../../images/Heather%20Grey.jpg" border="0" width="50" height="50"><br>
Heather Grey </td>
<td style="font-size: 8pt; font-family: Arial, Helvetica; color: #000000"
vAlign="top" align="middle" width="60">
<img src="../../images/White.jpg" border="0" width="50" height="50"><br>
White </td>
</tr>
</table></td>
<td class="features" vAlign="top" width="171" height="467">
<img src="../../images/Anvil.gif"
border="0" width="140" height="87"><br>
<font color="#339933" size="2"><b>Anvil Ladies Tank Top</b></font><br>
Fashion cut for ladies. Bound-on rib neck and armholes.
Double-needle bottom hem. 5.6 oz., 100% pre-shrunk heavyweight cotton.
Heather Grey: 90% cotton/10% polyester.<br>
<!---------------------------------begin selection form------------------------------>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<p>
<!----------------------------PROBLEM ONE------------------------------->
Color - <select onchange = "ReadForm (this.form);" tabindex="1">
<option value="Ash @7.10">Ash</option>
<option value="Black @7.10">Black</option>
<option value="Heather Grey @7.00">Heather Grey</option>
<option value="White @7.10">White</option>
</select>
</p>
<p>
<!----------------------------PROBLEM TWO------------------------------->
Size - <select onchange = "ReadForm (this.form);"
name="size" tabindex="2" style="width: 105; height: 105">
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="Extra Large">Extra Large</option>
<option value="2 Extra Large">2 Extra Large</option>
<option value="3 Extra Large">3 Extra Large</option>
</select>
</p>
<p>
<!----------------------------PROBLEM THREE------------------------------->
Volume - <select onchange = "ReadForm (this.form);" tabindex="3"
style="width: 104; height: 104">
<option value="Each">Each</option>
<option value="1 Doz +352.00">1 Doz</option>
<option value="3 doz +1234.00">1 Lot (3 Doz)</option>
<option value="24 doz +2200.00">24 Doz</option>
</select>
<p>
Total item cost >
<input type="text" name="tot" size="7" value="$7.10" />
</p>
<p align="center">
<br />Quantity > <!--webbot bot="Validation" b-value-required="TRUE"
i-minimum-length="1" i-maximum-length="3" --><input
type="text" name="quantity" size="3" value="1" tabindex="4" maxlength="3" /> </p>
<!----------------------------PROBLEM FOUR------------------------------->
<p align="center"> <input type="image" src="../../images/addtocart.gif"
value="Add to Cart" name="submit" width="106" height="24" />
<!----------------------------PROBLEM FIVE------------------------------->
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="fasttrack@adelphia.net" />
<input type="hidden" name="item_name" value="" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="baseamt" value="5.80" />
<input type="hidden" name="basedes" value="Style #815 Anvil Ladies Tank Top" />
</p>
<p align="center"> </p>
</form>
</td>
</tr>
</table></td>
</tr>
</table></body>
</html>
<!---------Problem One------------>
Each color has a different price per item.
<!---------Problem Two------------>
Sizes xsmall-xlarge are one price.
2x is another and
3x is yet another.....
<!---------Problem Three------------>
a. The customer will need to receive volume discounts based on their selection.
b. In the shopping cart description........<option value="1 Doz +352.00">1 Doz</option>.....the "+352.00 shows up.
c. FrontPage want to assign names to each form when I edit it. If I give the form a name it no longer works.
<!---------Problem Four------------>
The shopping cart window no longer pops up in a seperate window. It did when I first started editing the code but I must have screwed something up.
<!---------Problem Five------------>
If you choose an item that is white, small etc. etc. and add it to the cart then go back and order the same
If there is some readymade customizable code somewhere please let me know.
Thank You,