When a buyer clicks the “Add to Cart” button, a new window will appear listing the contents of the buyer’s PayPal Shopping Cart, including the item just added. To make the purchase, the buyer clicks “Checkout” from this window.
HTML Code Displayed Below:
This example uploads 1 item. It provides an idea of how the coding works.
* Sandbox URL: https://www.sandbox.paypal.com/cgi-bin/webscr
* Live Site URL: https://www.paypal.com/cgi-bin/webscr
<form action="<a href="https://www.paypal.com/cgi-bin/webscr" target="_blank">https://www.paypal.com/cgi-bin/webscr</a>" method="post">
Set the “cmd” variable to “_cart”
<input type="hidden" name="cmd" value="_cart">
Add a new variable called “add”
* add – Add to Cart buttons
<input type="hidden" name="add" value="1"> <input type="hidden" name="business" value="<a href="mailto:paypal.testing@gmail.com" target="_blank">paypal.testing@gmail.com</a>"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name" value="PayPal Shopping Cart"> <input type="hidden" name="amount" value="24.00"> <input type="hidden" name="return" value="<a href="http://www.yoursite.com/thankyou.htm" target="_blank">http://www.yoursite.com/thankyou.htm</a>"> <input type="image" src="<a href="http://www.paypal.com/en_US/i/btn/sc-but-01.gif" target="_blank">http://www.paypal.com/en_US/i/btn/sc-but-01.gif</a>" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form>
You can use the same code in your live site by changing the URL of the action line to point to the live PayPal site.
You must first be logged into your Sandbox Developer Account to test your PayPal Shopping Cart button code.
DEMO:
Thanks.
