Integration Guide

Table Of Contents
Website Payments Standard Checkout Integration Guide November 2005 75
Multiple-Item Payment: Shopping Cart
Sample HTML for PayPal-Hosted Shopping Cart
4
Paste the code you just copied into your web page file where you would like your “View
Cart” button to appear, by either pressing Ctrl+V or by right-clicking your mouse and
choosing Paste.
Sample HTML for PayPal-Hosted Shopping Cart
The following HTML is of a generic Add to Cart button created with the PayPal Shopping
Cart button factory. Several optional fields are shown.
EXAMPLE 4.1 HTML for PayPal-Hosted Shopping Cart “Add to Cart” Button
IMPORTANT:You can change the values for any of the variables, with the exception of the
first two lines.
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<!-- The PayPayl-hosted shopping cart is specified with the command _cart -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="seller@designerfotos.com”>
<!-- add the item to the PayPal-hosted shopping cart -->
<input type=”hidden” name=”add” value=”1”>
<input type="hidden" name="item_name" value="Baseball Hat">
<input type="hidden" name="item_number" value="12345">
<!-- No currency_code variable specified, so monetary amount is assumed to be USD -->
<input type="hidden" name="amount" value="12.95">
<table>
<tr>
<td>
<!-- allow customer to selection product option -->
<input type="hidden" name="on0" value="Color?">Color?
<select name="os0">
<option value="Red">Red
<option value="Green">Green
<option value="Blue">Blue
</select>
</td>
</tr>
</table>
<input type="image" src="https://www.paypal.com/images/x-click-but22.gif" border="0"
name="submit" alt="Make payments with PayPal - it’s fast, free and secure!">
</form>
Rather than creating a separate button for every single item you want to sell with the PayPal-
hosted shopping cart, you can edit the HTML to create different Add to Cart buttons.