I have a purchase page(this is due in 3 hours!!!, I will paypal $10 to whoever gives me the working code first).I have 2 Products
The Variables:
The one on the left is the Basic Model(in the code is reffered to as BasicQ(Meaning the Basic Model Quantity)
The one on the right is the Advance Model(in the code is reffered to as AdvQ(Meaning the advance model Quantity)
Pe(i use this to display text if both the fields are blank)
What i want this page to do is if the user clicks the submit button and if both quanity fields are 0 then display a text to the side saying “Please Enter a Quanity”. If Either one or both is not equal to 0 then i want them to be fowarded to a paypal page to purchase the products.
Here is the code :
on (release) {
BasicQ = bt.text;
AdvQ = at.text;
if ((BasicQ = “0”) && (AdvQ = “0”)){
pe = “Please Enter a Quanity…”;
}else if ((BasicQ != “0”) && (AdvQ != “0”)){
pe = " ";
pe = BasicQ + AdvQ + “test”;
}
}
//Code to send them to paypal
var paypal = new LoadVars();
paypal[“cmd”]="_xclick";
paypal[“business”]= “my@email.com”;
if ((AdvQ != “0”) && (BasicQ =! “0”)){
//Basic Model
paypal[“item_name_1”]= “XXX1”;
paypal[“item_number_1”]= “1OneTimeTAB”;
paypal[“amount_1”]= “79.99”;
//Advance Model
paypal[“undefined_quantity_2”]= AdvQ;
paypal[“item_name_2”]= “XXXX2”;
paypal[“item_number_2”]= “1OneTimeTAB”;
paypal[“amount_1”]= “89.99”;
paypal[“undefined_quantity_1”]= AdvQ;
paypal[“no_shipping”]= “2”;
paypal[“shipping”]= “15.00”;
paypal[“no_note”]= “1”;
paypal[“currency_code”]= “USD”;
paypal[“lc”]= “US”;
paypal[“bn”]= “PP-BuyNowBF”;
paypal.send(“https://www.paypal.com/cgi-bin/webscr","post”);
}
}
Here is an Image Example: