trouble adding a discount code to my shopping cart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right now, I am a stir-crazy woman because I cant figure this out.
Please help me!!
I am trying to add a discount code to each product in my shopping cart.
Ideally, I'd like to add a discount code in the cart on the total amount at checkout, but I think Paypal doesn't have that ability.
So I want to apply the code below, but without options. I just want to send one item with one price.
In the code below, how do I pass a single item to the shopping cart without providing options?
For example, instead of letting the customer choose small, med or lg, I just want to add an item to the shopping cart of size small for $9.99.
Here is the code I have, but it has options in it:
<html>
<head>
<title>Button Example Code</title>
<!-- START META TAG SECTION -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="Content-Language" content="en">
<!-- END META TAG SECTION -->
<!-- Start of Script -->
<script language = "javascript">
<!--
function validate(text1,text2) {
if (text1 == text2)
{
window.alert("Nice, you get a 10% Discount!");
}
if (text1 !== text2)
{
window.alert("Sorry, No Discount!");
}
}
function CalculateOrder(form) {
if (form.text1.value == "GOLD10")
{
form.discount_rate.value = "10";
form.discount_rate2.value = "10";
form.on3.value = "Coupon Entered";
form.os3.value = "GOLD10";
}
}
//-->
</script>
<!-- End of Script -->
</head>
<body>
<!-- START SAMPLE CODE SECTION -->
<!-- PARAGRAPH 1 -->
Discount & Coupon Examples
<br><br>
Add to Cart - Enter the Promo Coupon Code, Get a 10% Discount, on Screen Validation.
<br><br>
Notes:<br>
This example uses a script to verify the Promo Coupon Code and then applies the associated Discount Rate using the the "discount_rate" and the "discount_rate2" variables.
<br><br>
Give it a try, the Promo Coupon Code is: GOLD10
<br><br>
<!-- START CONTENTS -->
<!-- START BUTTON EXAMPLES -->
Widgets in Space
<br><br>
Widget Cupcakes
border="0"
<br><br>
<!-- Start of Add to Cart Form -->
<!-- Note: target="paypal" was replaced with the variable target="_self" -->
<!-- Note: shopping_url also added to code -->
<!-- These two changes allow better functionality with IE and Firefox -->
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable in your View Cart code. -->
<input type="hidden" name="cpp_header_image" border="0" value="https://yourwebsite.com/logo.jpg">
Please Choose One:  
<input type="hidden" name="on0" border="0" value="Choice">
<select name="os0">
<option value="Standard, 6 each per Box" border="0" selected>Standard, 6 each per Box - $9.95</option>
</select>
<input type="hidden" name="os0" value="pay-in-4"> ...
<input type="hidden" name="option_select0" value="pay-in-4 too">
<!-- option_index value=0 is associated with variable on0 -->
<!-- option_index value=1 is associated with variable on1 -->
<input type="hidden" name="option_index" border="0" value="0">
<!-- -->
<input type="hidden" name="option_select0" border="0" value="Standard, 6 each per Box">
<input type="hidden" name="option_amount0" border="0" value="9.95">
<input type="hidden" name="option_item_number0" border="0" value="S-6-BOX">
<br><br>
<!-- Start Coupon Validate -->
Enter Promo Coupon - Get 10% Off:
   
<input type="text" name="text1" border="0" >
<input type="button" value="Apply" border="0" name="Submit" onclick=javascript:validate(text1.value,"GOLD10") >
<!-- End Coupon Validate -->
<br><br><br>
<input type="image" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" onclick=CalculateOrder(this.form) name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" border="0" value="1">
<input type="hidden" name="cmd" border="0" value="_cart">
<!-- Replace "business" value with your PayPal Email Address or Account ID -->
<input type="hidden" name="business" border="0" value="myemailaddress">
<input type="hidden" name="item_name" border="0" value="All-in-One Kit for Autism Communication">
<input type="hidden" name="no_shipping" border="0" value="2">
<input type="hidden" name="discount_rate" border="0" >
<input type="hidden" name="discount_rate2" border="0" >
<input type="hidden" name="something" border="0" >
<input type="hidden" name="else" border="0" >
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" name="shopping_url" border="0" value="http://www.speciallysmart.com/Shop.html">
<!-- Replace value with the web page you want the customer to return to after a successful transaction -->
<input type="hidden" name="return" border="0" value="http://www.speciallysmart.com/ThankYou.html">
<!-- Replace value with the web page you want the customer to return to after item cancellation -->
<input type="hidden" name="cancel_return" border="0" value="http://www.speciallysmart.com/Cancel.html">
<input type="hidden" name="currency_code" border="0" value="USD">
<input type="hidden" name="lc" border="0" value="US">
<input type="hidden" name="button_subtype" border="0" value="products">
<input type="hidden" name="no_note" border="0" value="0">
<input type="hidden" name="cn" border="0" value="Add special instructions to the seller:">
<input type="hidden" name="bn" border="0" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
</form>
<!-- End Add to Cart Button Code -->
<br>
<!-- Start of View Cart Button Code -->
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable in your View Cart code. -->
<input type="hidden" border="0" name="cpp_header_image" value="https://yourwebsite.com/logo.jpg">
<input type="hidden" border="0" name="cmd" value="_cart">
<input type="hidden" border="0" name="display" value="1">
<!-- Replace "business" value with your PayPal Email Address or Account ID -->
<input type="hidden" border="0" name="business" value="myemail">
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" border="0" name="shopping_url" value="http://www.speciallysmart.com/Shop.html">
<input type="image" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<!-- End of View Cart Button Code -->
<!-- END BUTTON EXAMPLES -->
<!-- END SAMPLE CODE SECTION -->
<br><br>
<br><br><br><br>
<hr align="left" width="50%" noshade>
<br><br>
NOTES:
<br>
In order to test the code, you must replace the "business" value variable with your PayPal Email Address or Account ID in both the View Cart button and the Add to Cart button.
</body>
</html>
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- transactions will not stay archived in About Payments
- Paypal limited my account in About Settings
- Please allow 10 % offer discount to be applied again. in About Payments
- trouble with Paypal and online shop in About Business
- PayPal $5 off $50 purchase offer at Target - does this work? in About Payments