The following button code uses the JavaScript shown above to apply a 10 percent discount. The first FORM command just gives the discount with no questions. Your site would proclaim a 10 percent discount on all products for the next week. The script displays the original prices on the site, but applies a 10 percent discount to all items ordered.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target = 'paypal';
discnt = 10;
coupval = '(blanket)';
ReadForm (this);
discnt = 0;">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="your_email_goes_here@your_site.com" />
<input type="hidden" name="item_name" value="Test Item" />
<input type="hidden" name="amount" value="10.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="baseamt" value="10.00" />
Input quantity >
<input type = "text"
name = "quantity"
value = "1"
size = "3" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>