Integration Guide

Table Of Contents
Website Payments Standard Integration Guide September 2008 231
The PayPal Shopping Cart – Add to Cart and View Cart Buttons
Sample HTML Code for Add to Cart Buttons
4
The sample code above produces the following result on your webpage.
Paste the code onto your webpage below an image or a text description of the item.
Sample Code for an Add to Cart Button With Product Options With Prices
The sample code below illustrates a basic Add to Cart button with a dropdown menu of
product options that have separate prices for each option. Only one of the dropdown menus in
the set product options that your Add to Cart button offers can have prices.
Product options with prices specify the prices in two places:
z The dropdown menu displays the prices for each option – buyers see the prices they pay for
each option.
z A list of hidden HTML variables repeats the prices for each option – PayPal uses these
prices to charge buyers for the options they choose.
Dropdown menus with option prices use the following variables:
z currency_code – sets the currency for option prices
z item_index – identifies which dropdown menu of product option has prices
z option_select* and option_amount* – repeats the prices for each option
N OTE: You cannot specify item IDs for production options with prices to have PayPal track
inventory for your item. PayPal can track inventory by product option only for buttons
that you save in your PayPal account.
<form target="paypal" 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 an 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="currency_code" value="USD">
<!-- Provide a dropdown menu option field. -->
<input type="hidden" name="on0" value="Color">Color scheme <br />
<select name="os0">
<option