Integration Guide

Table Of Contents
PayPal Payments Standard Integration Guide June 2012 293
The PayPal Shopping Cart – Add to Cart and View Cart Buttons
Sample HTML Code for Add to Cart Buttons
6
Values for “Target” That Open the PayPal Shopping Cart
The sample HTML code below for an Add to Cart button illustrates how to open the PayPal
Shopping Cart in the browser window that displays the merchant website.
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="kin@kinskards.com">
<!-- Specify a PayPal Shopping Cart Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name"
value="Birthday - Cake and Candle">
<input type="hidden" name="amount" value="3.95">
<input type="hidden" name="currency_code" value="USD">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
See also “Sample HTML Code for a View Cart Button That Opens the Shopping Cart in the
Merchant Window” on page 301.
Sample HTML Code for Add to Cart Buttons that Continue Shopping on the
Current Merchant Webpage
When buyers click Add to Cart buttons, the PayPal Shopping Cart page opens. Buyers can see
the items in their carts, and they can begin checking out. In addition, buyers can click the
Continue Shopping button to return to your website and add more items to their carts.
Target expression Where the PayPal Shopping Cart Opens
target="paypal" The PayPal Shopping cart opens in a browser window
or browser tab that is separate from the browser window
or tab that displays the merchant website.
target="_self" The PayPal Shopping cart opens in the browser window
or browser tab that displays the merchant website.