Add % discount to Add to Cart HTML paypal button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried several times and relied on the code snippets examples provided by paypal (https://www.paypal.com/mq/smarthelp/article/how-do-i-create-a-discount-code-or-coupon-code-for-my-pa...). Yet my button doesn't show any % discount as it should. This is the HTML code snippet, trying to implement a 10% discount (I have just hidden my merchant ID):
<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="XXX" />
<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 type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!" name="submit" alt="add to cart" />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<script type="text/javascript">
<!--
discnt = 10; // set blanket 10% discount
//-->
</script>
</form>
Does any of you know what am I missing/how to fix it? Thank you so much, take the chance to wish you a good day!
- Labels:
-
PayPal HTML Buttons
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Using Paypal Smart Buttons for checkout sometimes fails with Debit/ Credit Cards Form in Braintree Client-side Integration (JS, iOS, Android SDKs)
- paypal buttons can't show in PayPal Payments Standard
- Sandbox testing has beaten me !! in Sandbox Environment
- Customising Paypal Checkout Button in PayPal Payments Standard
- recurring payments when price maybe changed and price have 2 decimal point in REST APIs