The PayPal Shopping Cart – Add to Cart and View Cart Buttons

With the PayPal Shopping Cart, you can let buyers select multiple items on your website and pay for them with a single payment. Buyers click Add to Cart buttons to add items to their PayPal Shopping Carts, and they click View Cart buttons to review the items in their carts before they check out and make their payments.

You can create Add to Cart buttons that you add to your website by using a tool on the PayPal website, or you can write the HTML code for PayPal hosted Add to Cart buttons manually. You can create buttons with limited functionality before you create your PayPal account or with JavaScript disabled in your browser.

Read the following topics to learn more about the PayPal Shopping Cart:

Getting Started With The PayPal Shopping Cart

The easiest way to add the PayPal shopping cart to your website is to create Add to Cart and View Cart buttons by using a tool on the PayPal website. As soon as you add the buttons, you can begin accepting payments on your website.


Do the following to add the PayPal Shopping Cart to your website:

Getting Started With Add To Cart Buttons

Follow one of these procedures to get started creating your own Add to Cart buttons:

Using the Button Creation Tool for a Basic Add to Cart Button

To use the button creation tool for a basic Add to Cart button:

  1. Log in to your PayPal Premier or Business account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the My Saved Buttons link.

    The My Saved Buttons page opens.

  4. In the Related Items box on the right, click the Create new button link.

    The Create PayPal payment button page opens.

  5. In the Choose a button type dropdown menu, select "Shopping cart."
  6. Enter the payment details of your item.
    • Item name – Enter the name of the item or service that you wish to sell.
    • Price – Enter the price of your item.
  7. Scroll to the bottom of the page, and click the Create Button button.

    The You are viewing your button code page opens.

  8. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  9. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  10. In your web editing tool, open the webpage where you want the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  11. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

Creating Add to Cart Buttons Before You Create Your PayPal Account

You can create basic Add to Cart buttons, add them to your website, and begin accepting payments before you sign up for your PayPal account. Read the following topics to learn more about creating Add to Cart buttons before you create your PayPal account.

Creating a Basic Add to Cart Button Without a PayPal Account

  1. Go to the PayPal website at https://www.paypal.com.
  2. Click the Business tab.
  3. Click Accept Credit Cards on a Website.
  4. Under the PayPal Payments Standard heading, click the Select button.

    A page that describes PayPal Payments Standard opens.

  5. Click the Try it now button.

    The Create PayPal payment button page opens.

  6. In the Choose a button type dropdown menu, select "Shopping cart."
  7. Enter the payment details of your item.
    • Item name – Enter the name of the item or service that you wish to sell.
    • Price – Enter the price of your item.
    • Email address to receive payments – Enter the email address that you will use when you sign up for your PayPal account.
  8. Scroll to the bottom of the page, and click the Create Button button.

    The You've created your button page opens.

  9. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  10. Do one of the following to copy the selected text to the clipboard:
    • For Windows and Mac, right-click on the code, and then select Copy.
    • For Windows, press Ctrl+C.
    • For Mac, press CMD+C.
  11. In your web editing tool, open the webpage where you want to show the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  12. Do one of the following to paste the text from the clipboard onto your webpage, where you want the button to appear:
    • For Windows or Mac, right-click on the code, and then select Paste.
    • For Windows, press Ctrl+V.
    • For Mac, press CMD+V.
Limitations of Add to Cart Buttons Created Without a PayPal Account

Consider the following limitations of payment buttons that you create and add to your website before you sign up for your PayPal account.

  • You cannot claim the payments that people authorize during checkout. PayPal collects and holds the payments as unclaimed until you sign up for your PayPal account.
  • Buyers must have a PayPal account to pay you.
  • PayPal limits the features that you can specify with the button creation tool, such as:
    • Saving your buttons in your PayPal account
    • Tracking inventory or profit and loss
Note: You cannot create payment buttons without a PayPal account if Javascript is disabled in your browser.
Unclaimed Payments From Buttons Created Without a PayPal Account

For buttons that you create without a PayPal account, payments that buyers authorize are held as unclaimed by PayPal until you sign up. PayPal holds your unclaimed payments under the email address that you specify when you create the buttons. Make sure to use the same email address when you sign up for your account. Otherwise PayPal cannot transfer your unclaimed payments to your PayPal account balance.

In their PayPal accounts, buyers see unclaimed payments that they made to you from Add to Cart buttons that you created without a PayPal account. Such unclaimed payments are displayed in their recent account activity and in their transaction history. Until you finish signing up for your PayPal account, buyers can cancel your unclaimed payments and recover their funds.

Figure 1. Unclaimed Payments From Buttons Created Without a PayPal Account

Getting Started With View Cart Buttons

You need to create only one View Cart button, regardless of the number of Add to Cart buttons that you create and add to your website. View Cart buttons on your website let buyers view their shopping carts and the items in them. From there they can proceed to checkout.

Follow one of these procedures to get started creating your own View Cart buttons:

Using the Button Creation Tool for a View Cart Button

Each time you create an Add to Cart button, PayPal gives you a chance to create a View Cart button. You can use the generated HTML code for any of these View Cart buttons – the code is identical. Paste the same HTML button code onto your webpages for as many View Cart buttons as you need.

To use the button creation tool for a View Cart button:

  1. Log in to your PayPal Premier or Business account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the Create new button link.

    The Create PayPal payment button page opens.

  4. In the Accept payments for dropdown menu, select "Shopping cart."
  5. Enter the payment details of your item.
    • Item name – Enter any name.
    • Price – Enter any price.
  6. Scroll to the bottom of the page, and click the Step 2 bar.

    The Step 2 – Track inventory, profit and loss (optional) section of the tool expands to fill the page.

  7. Clear the Save button at PayPal checkbox.
  8. Click the Create Button button.

    The You are viewing your button code page opens.

  9. Click the Create a View Cart button link.

    The Create PayPal payment button page opens.

  10. Click the Create button button.

    The You've Created Your Button page opens.

  11. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  12. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  13. In your web editing tool, open the webpage where you want the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  14. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

Creating View Cart Buttons Before You Create Your PayPal Account

You can create View Cart buttons before you create your PayPal account and add them to your website. However, to begin accepting payments, you must add some Add to Cart buttons, as well.

Note: You cannot create payment buttons without a PayPal account if Javascript is disabled in your browser.

Each time you create an Add to Cart button, PayPal gives you a chance to create a View Cart button. You can use the generated HTML code for any of these View Cart buttons – the code is identical. Paste the same HTML button code onto your webpages for as many View Cart buttons as you need.

To create a View Cart button without a PayPal account:

  1. Visit the PayPal website at https://www.paypal.com.
  2. Click the Business tab.
  3. Under the Need to accept credit cards? heading, click the On your website link.

    The Choose a payment solution page opens.

  4. Under the PayPal Payments Standard heading, click the Learn more link.

    The PayPal PayPal Payments Standard: Overview page opens.

  5. Under the Sell multiple items heading, click the Create payment button link.

    The Create PayPal payment button page opens.

  6. In the Accept payments for dropdown menu, select "Products" or "Services".
  7. Select the Yes; create an "Add to Cart" button radio button.
  8. Enter the payment details of an item.
    • Item name – Enter any name.
    • Price – Enter any price.
    • Email address to receive payments– Enter the email address that you will use when you sign up for your PayPal account.
  9. Click the Create Button button.

    The PayPal account required for this button type message box appears.

  10. Click the close icon in the upper right corner of the message box to proceed.

    The You've created your button page opens.

  11. Click the Create a View Cart button link.

    The Create PayPal payment button page opens.

  12. Click the Create button button.

    The PayPal account required for this button type message box appears.

  13. Click the close icon in the upper right corner of the message box to proceed.

    The You've created your button page opens.

  14. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  15. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  16. In your web editing tool, open the webpage where you want the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  17. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

The Checkout Experience With the PayPal Shopping Cart

This section demonstrates the PayPal checkout experience for people who click Add to Cart and View Cart buttons on your website. The following diagram illustrates the steps.

Figure 2. The Checkout Experience with Add to Cart and View Cart Buttons

Read these topics to better understand the checkout experience with Add to Cart and View Cart buttons:

Begin – Buyers Add Your Items to the PayPal Shopping Cart

The basic checkout experience with the PayPal Shopping Cart begins when someone on your website adds your items to the cart and then views it to check out.

Figure 3. Buyers Add Your Items to the PayPal Shopping Cart

In this example, Steve begins on Kin's Kards website, looking for birthday cards. Steve clicks the Add to Cart buttons under two cards that he wants. Then, he clicks the View Cart button to review his selections.

PayPal displays a shopping cart page, which lets buyers review their selections, specify quantities, and remove items before proceeding to check out. If you set up shipping rates in your account profile, a shipping calculator displays at the bottom of the cart. When the buyers enter their zip codes, the shipping calculator determines the shipping amount and adds it to the total. If your account has sales tax associated with that zip code, the calculator also determines the tax amount and adds it to the total. If the buyer changes the zip code, the calculator uses the new zip code to recalculate the shipping and tax amounts.

Figure 4. Buyers Review Their Selections in the PayPal Shopping Cart

In this case, Steve is satisfied with his selections and the transaction amount. He clicks the Proceed to Checkout button.

1 – Buyers Enter Their Billing Information or They Log In To PayPal

PayPal displays a billing information/log-in page, which lets buyers enter their credit card information or log in to PayPal to pay.

Figure 5. Buyers Enter Their Billing Information or Log In to PayPal

For the PayPal Shopping Cart, the PayPal billing information/log-in page shows transaction details on the left, such as the item names and the transaction total.

If buyers are satisfied with the details, they do one of the following to select a payment method:

  • Have a PayPal account? – Buyers click this link, enter their PayPal credentials, and click the Log in button.
  • Don't have a PayPal account?– Buyers enter their billing information. They also enter their contact information – email address and home phone number– so that PayPal can send their PayPal transaction receipts and can contact them if necessary to complete the transaction. Then, they click the Review Order and Continue button.

    If your website gathers information about your buyer, you can define HTML code to prepopulate (prefill) the corresponding billing information fields. In this case, the buyers see a collapsed version of the billing information section. For example, if you prefilled the billing address, the address information displays on the page without the entry fields. Each prefilled section of information is followed by a change link to let the buyers modify the information, if necessary.

    For more information about prepopulation, see Filling Out FORMs Automatically with HTML Variables.

In this case, Steve is satisfied with the total transaction amount of $14.28 USD. He enters his billing and contact information, and then clicks the Review Order and Continue button.

2 – Buyers Confirm Their Transaction Details Before Paying

PayPal displays a transaction confirmation page to let buyers confirm the details before they complete their transactions and authorize their payments.

Figure 6. Buyers Confirm Their Payment Details Before Paying

In this case, Steve reviews the transaction details and clicks the Pay Now button to complete the transaction and make his payment.

3 – Buyers View and Print Their PayPal Payment Confirmations

PayPal displays a payment confirmation page after buyers pay to let them know that they have completed their transactions and authorized their payments successfully.

Figure 7. Buyers View Their Payment Confirmations

From the payment confirmation page, buyers can:

  • View the PayPal transaction ID to reconcile their payments.
  • Click the Print receipt link to print receipts for their records.
    Figure 8. Buyers Print Their PayPal Payment Receipts

    In this case, Steve prints the PayPal payment receipt for his records.

End – Buyers Receive Payment Authorization Notices by Email

PayPal sends buyers a payment authorization notice by email to confirm the transaction that they made with the merchant.

In this case, PayPal sends Steve an email message notifying him of his transaction with Kin's Kards and his authorization for payment of $14.28 USD.

Enhancing the Checkout Experience With Add to Cart Buttons

Calculating Tax and Shipping Amounts

The basic checkout experience handles tax and shipping, if you provide the information.You can enhance the checkout experience by specifying tax and shipping rates in your account profile. PayPal calculates the charges automatically for each transaction. In addition, you can specify tax and shipping charges individually for items in the payment buttons that you create.

For more information, see:

Co-Branding the Checkout Pages with Your Logo and Colors

The basic checkout experience displays your email address or your business name in the upper left corner of the checkout pages. You can enhance the checkout experience by setting up custom page payments in your account profile to specify logos and colors that match the style of your website. PayPal uses the logo and colors to display the checkout pages. In addition, you can specify logos and colors with advanced HTML variables that you add to the code of your button.

For more information, see:

Prepopulating the Checkout Pages With Billing and Shipping Addresses

The basic checkout experience has forms for filling in billing and shipping information. You can enhance the checkout experience by prepopulating the forms with information that you have on your website about the buyer.

To learn more about prepopulation, see Filling Out FORMs Automatically with HTML Variables.

To learn more about the HTML variables to use, see HTML Variables for Filling Out PayPal Checkout Pages Automatically

Returning Buyers to Your Website After They Check Out

The basic checkout experience leaves buyers on the PayPal website after they check out. Use one of the following techniques to enhance the checkout experience so that buyers return to your website instead of the PayPal website.

  • Return URL – Let buyers return to a page on your website if they click a return link or button on the PayPal payment confirmation page.

    To learn more, see Step 4 of Page 2 – Adding More Details to the PayPal Shopping Cart Button or HTML Variables for Displaying PayPal Checkout Pages.

  • Auto Return – Have PayPal return people automatically to a page on your website.
    Important: PayPal recommends that you turn Payment Data Transfer on when you turn Auto Return on. With Auto Return on, PayPal redirects buyers to your website from an alternative PayPal payment confirmation page, which does not allow them to print PayPal receipts. Payment Data Transfer provides the transaction information that you need to let buyers print receipts from your website.

    To learn more, see Auto Return.

  • Payment Data Transfer – PayPal includes information about the completed transaction when you use a return URL or Auto Return to send people back to your website. Use the information that Payment Data Transfer provides to display a "thank you, print your receipt" page on your website.

    To learn more, see the Payment Data Transfer webpage on PayPal Developer Network..

Managing PayPal Shopping Cart Transactions

Using Email Notices to Track PayPal Shopping Cart Transactions

PayPal sends you email notices when:

  • Payments are made.
  • Payments are pending.
  • Payments are canceled.

Generally, PayPal sends email notices to the primary email address of your account.

PayPal can send email notices to an alternate email address, such as to someone in your organization who handles order processing or accounting. Add the additional email address to your account profile. Then, use that email address as the one to receive payments when you use the button creation tool on the PayPal website to create your Add to Cart buttons. Specify the alternate email address as the value for the business HTML variable when you write the HTML code yourself for your Add to Cart buttons.

For more information, see Step 4 in the instructions for Page 2 – Adding More Details to the PayPal Shopping Cart Button, or HTML Variables for PayPal Payments Standard."

Using Recent Activity to Track PayPal Shopping Cart Transactions

PayPal displays PayPal Shopping Cart transactions in your recent activity, soon after buyers complete them by clicking Add to Cart buttons and checking out on your website.

Figure 9. Using Recent Activity to Track PayPal Shopping Cart Transactions

To view your recent history:

  1. Log in to you PayPal account.
  2. Navigate to My Account > Overview.

    The My Account Overview opens.

  3. Scroll down to the Recent Activity table near the bottom of the page.

Using Transaction History to Track PayPal Shopping Cart Transactions

PayPal lets you search for PayPal Shopping Cart transactions on the History page. The status of payments found there can be:

  • Completed – Transactions were successful, and funds were credited to your account
  • Cleared – Payments cleared senders' accounts, and funds were credited to your account
  • Uncleared – Payments have not cleared sender's accounts, and funds were not credited

To learn how to work with transaction history, see the Merchant Setup and Administration Guide.

Using Downloadable History Logs to Track PayPal Shopping Cart Transactions

PayPal lets you download your PayPal Shopping Cart transactions to your computer from the History page. You can specify a date range for the transactions and the file format of the download file.

To learn how to work with downloadable history logs, see the Merchant Setup and Administration Guide.

Using Instant Payment Notification to Track PayPal Shopping Cart Transactions

PayPal lets your web server receive messages about PayPal Shopping Cart transactions and payment activity on your account. If you activate Instant Payment Notification, PayPal sends messages when:

  • Payments are first made, with a status of completed or pending.
  • Payments clear, fail, or are denied, if the initial status was pending.

To learn more about Instant Payment Notification, see Instant Payment Notification – notify_url and the Merchant Setup and Administration Guide.

Advanced Features of Add to Cart Buttons

Read the following topics to learn about these advanced features of Add to Cart buttons:

Offering Product Options With Add to Cart Buttons

Prompt buyers for product options, such as size or color. You can prompt buyers for their option selections with dropdown menus or with text boxes. PayPal limits you to 7 product options on a single payment button. Up to 5 options can prompt for selections with dropdown menus, and up to 2 options can prompt for selections with text boxes.


With Add to Cart buttons, you can offer a product option that has separate prices for each selection by using 1 of the 5 allowable dropdown menus.

Specifying Product Options With Add to Cart Buttons

Do one of the following to create Add to Cart buttons that offer product options:

Offering Discounts With Add to Cart Buttons

PayPal allows you to offer a discount for an item. You can offer item discounts either as an amount or a percentage.

  • Set a discount amount that applies to single or multiple quantities of the item. You can set a discount for the first item and a different discount for the additional quantity, and you can limit the total quantity to which the discount applies.
  • Set a discount percentage that applies to single or multiple quantities of the item. You can set a discount for the first item and a different discount for the additional quantity, and you can limit the total quantity to which the discount applies.

When you set a discount amount or percentage, you can limit the number of items to which the discount applies. Any applicable tax calculations occur after subtracting the discount.

The discount amount displays on all pages, email messages, and reports that show payment information.

Specifying item discounts

Do one of the following to create Add to Cart buttons that specify discounts:

Creating Advanced PayPal Shopping Cart Buttons on the PayPal Website

The Basic Steps for Using the Tool With Add to Cart Buttons

The button creation tool for Add to Cart buttons is a single webpage with three sections:

  • Step 1 – Choose button type and enter payment details – This section lets you specify the details of your Add to Cart button. You can specify product options that buyers can choose, and you can specify item-specific charges for shipping and tax.
  • Step 2 – Track inventory, profit and loss (optional) – This section lets you control whether to save your button in your PayPal account. If you save your button, you can enter information that PayPal uses to track inventory and to track your profit and loss on the item.
  • Step 3 – Customize advanced features (optional) – This section lets you work with advanced features of Add to Cart buttons. If you are familiar with HTML programming and the advanced HTML variables supported by PayPal Payments Standard buttons, you can enter them here.

One section at a time is open for you to work with. To work with another section, click its step bar to expand it.


You can switch between the sections as often as you like, until you click the Create Button button at the bottom of the page. Then, PayPal generates the code for your button and displays it on the You are viewing your button code page. Copy the code and paste it onto your webpage, and your payment button is complete.

Saving Add to Cart Buttons in Your PayPal Account

By default, the button creation tool saves payment buttons in your PayPal account. The tool saves your button and generates the code when you click the Create Button. You must copy and paste the generated code onto your webpages, whether or not you save your button at PayPal. The generated code is shorter for saved buttons, because PayPal keeps most of the information about your button in your account instead of placing it in the code that you add to your website.

Saving your payment buttons in your PayPal account has these benefits:

  • Your payment buttons are more secure, because the generated code that you add to your website contains no information that can be tampered with to produce fraudulent payments.
  • You can edit the details and options for your payment buttons in your PayPal account, without changing the button code that you added to your website.
    Note: If you change product options, you must copy and paste the code newly generated by PayPal to replace the code that you pasted previously.
  • You can track inventory, and you can track profit and loss.

Use the Step 2 section of the button creation tool to control whether your button is saved in your PayPal account.

Tracking Inventory and Tracking Profit and Loss

PayPal can track inventory and can track profit and loss for items that you sell with Add to Cart buttons if you save them in your PayPal account. You can track inventory and profit and loss for the item itself or by its product options.

If you track inventory, PayPal helps you avoid oversold situations. PayPal sends you an alert by email when your inventory on hand falls to or below the alert level you specify. You have the option to let oversold transactions go through or to warn buyers and prevent them from buying more than your quantity on hand.

If you track profit and loss, PayPal helps you understand the profitability of your items. You enter the cost of your item, including the price that you pay to acquire the item, as well as other activity costs that you incur, such as warehousing, quality control, and administrative overhead. PayPal then provides profit and loss reports based on the volume of sales.

Use the Step 2 section of the button creation tool to specify the information that PayPal uses to track inventory and to track profit and loss. You can have a maximum of 1,000 saved buttons in your PayPal account.

Adding Advanced Features to Add to Cart Buttons With HTML Variables

Some advanced features of payment buttons can be specified only with HTML variables. If you are familiar with HTML programming and the advanced HTML variables supported by PayPal Payments Standard payment buttons, you can enter them in the button creation tool before the button code is generated.

Use the Step 3 section of the button creation tool to enter advanced HTML variables that you want to include in your payment button.

For more information, see Step 5 of Step 3 – Adding Advanced Features to Your Add to Cart Button.

Pricing Items in Multiple Currencies

All items that buyers add to carts must be priced in the same currency. The first item that buyers add to an empty cart determines the currency for all items in the shopping cart. The cart uses the currency that you selected for your Add to Cart buttons when you created them.

After a buyer adds the first item to a shopping cart, the buyer cannot add items priced in other currencies. To change the currency of a shopping cart, a buyer must purchase the items in the cart with the current currency or empty the cart and add items priced in the other currency.

To avoid shopping difficulties that arise with multiple currencies, price all of your items in the same currency. If you must price items in multiple currencies, let buyers choose the currency for viewing your catalog and display prices on your website only in the currency that the buyer selected.

Working with View Cart Buttons

You need to create only one View Cart button, regardless of the number of Add to Cart buttons that you create and add to your website. View Cart buttons on your website let buyers view their shopping carts and the items in them. From there they can proceed to checkout.

Each time you create an Add to Cart button, PayPal gives you a chance to create a View Cart button. Paste the same HTML button code onto your webpages for as many View Cart buttons as you need.

The HTML button code that PayPal generates for View Cart buttons does not require protection, because the code does not contain any payment information. You can use the generated HTML code for any View Cart buttons that you create – the code is identical.

Generating Code for Payment Buttons and Email Payment Links

When you create Add to Cart buttons with tools on the PayPal website, PayPal generates HTML code for website payment buttons. Then, you copy and paste the HTML code onto the pages of your website.

In addition to HTML code, PayPal generates URL code for email payment links. Use email payment links to add Add to Cart functionality to your email messages. If your web editing tool or your service provider does not allow you to paste HTML code onto your webpages, you may be able to paste the URL code for email payment links onto your webpages instead.

Protecting HTML Code for Payment Buttons

When you create Add to Cart code with tools on the PayPal website, PayPal lets your protect the HTML button code that it generates by encrypting part of it. Protecting the HTML code of your payment buttons helps protect against malicious tampering and fraudulent payments.

Important: Merchants with significant payment volume are required to take precautions on securing PayPal Payments Standard buttons.

For more information, see Securing Your PayPal Payments Standard Buttons."

Step 1 – Specifying Basic Features of Your Add to Cart Button

To begin using the button creation tool for Add to Cart buttons:

  1. Log in to your PayPal Premier or Business account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, do one of the following:
    • Click the My Saved Buttons link, and then click the Create new button link in the upper right of the page, if you previously saved payment buttons in your PayPal account.

      To create a new button that is similar to a button that you saved, find the saved button in the list. Then, click the Action dropdown menu at the right and click the Create similar button link.


    • Click the Create New Button link, if you have no buttons saved in your PayPal account.

    The Create PayPal payment button page opens.

  4. Under the Selling Preferences heading, click the My Saved Buttons link.

    The My Saved Buttons page opens.

  5. In the Related Items box on the right, click the Create new button link.

    The Create PayPal payment button page opens.

  6. In the Choose a button type dropdown menu, select "Shopping cart."
  7. Enter the payment details of your item.
    • Item name – Enter the name of the item or service that you wish to sell.
    • Item ID – (optional) Enter the inventory ID or tracking number of your item, if you assign such IDs to your products.

      If you want to set up your item so that PayPal tracks inventory levels, enter a value that is unique among all the items that you sell and want PayPal to track. For more information, see Step 2 – Tracking Inventory With Your Add to Cart Button.

    • Price – Enter the price of your item.

      If you want to add product options with different prices for each option that buyers can select, do not enter a price here. For more information, see Step 8 below.

    • Currency – Select the currency in which you priced the item; the dropdown menu automatically selects the currency of your primary balance.

      If you want to customize the country and language of the button, make sure that you select an appropriate currency here. For more information, see Step 9 below.

  8. Customize your button with product options (optional).

    Do any of the following:

    • Add dropdown menu with price/option – Select this checkbox to add a dropdown menu of product options, with a separate price for each option.

      Enter a name for the dropdown menu, such as "Color". For each menu option, enter a name, such as "Red", "Blue", or "Green", and the price you want buyers to pay. Select the currency for your prices from the dropdown menu. You can add a maximum of 10 priced options to the menu.

      Click the Done button to preview the dropdown menu in the Buyer's View pane.

      Click the Edit link to change the name and options of your dropdown menu. To remove an option, clear the menu option name and price, and then click the Done button.

      Click the Delete link to remove the dropdown menu from your button.

    • Add dropdown menu without prices – Select this checkbox to add a dropdown menu of product options, without separate prices.

      Enter a name for the dropdown menu, such as "Size". For each menu option, enter a name, such as "Small", "Medium", or "Large".

      Click the Done button to preview the dropdown menu in the Buyer's View pane.

      Click the Edit link to change the name and options of your dropdown menu. To remove an option, clear the menu option name and click the Done button.

      Click the Delete link to remove the dropdown menu from your button.

      Click the Add another dropdown menu link to open a set of fields for another dropdown menu of options without prices. You can add a maximum of 4 dropdown menus, with a maximum of 10 options per menu.

    • Add text field – Select this checkbox to add a text box in which buyers can enter option information.

      Enter a name for the text box, such as "Enter the text you want engraved".

      Click the Done button to preview the text field in the Buyer's View pane.

      Click the Edit link to change the name of the text field.

      Click the Delete link to remove the text box from your button.

      Click the Add another text box link to open a field for the name of another text box. You can add a maximum of 2 boxes.

    For more information, seeOffering Product Options With Add to Cart Buttons .

  9. Customize the appearance and the language of your button (optional).

    Click the Customize appearance link and select one of the following:

    • PayPal button – Select this radio button to use a button image that is hosted by PayPal. You can configure the size of the button, specify whether the button displays payment card logos, and specify the country and language for the button text.

      If you change the country, ensure the currency that you selected in Step 7 above is appropriate.

    • Use your own button – Select this radio button to specify the URL of your own button image that is not hosted by PayPal. Use your own button image if the buttons hosted by PayPal do not fit the look of your website.

      If your image is hosted securely, change the text box to begin with https://.

  10. Add shipping charges and tax rates to your item (optional).

    You can add shipping charges and tax rates for your item here. They override the tax and shipping rates that PayPal calculates automatically based on rates that you specify in your account profile.

    • Shipping – Enter a specific amount to charge for shipping this item.

      The currency for the amount is the same as the currency for the item. Enter zero (0.00) for items that do not incur shipping charges. The amount you enter here overrides the automatic calculation of shipping charges on the item.

      Note: Before you can accept payments from Add to Cart buttons with specific shipping costs entered here, you must enable the override of shipping methods in the Shipping Calculations section of your account profile. You can create your button successfully, but you cannot accept payments from your button until you enable shipping cost overrides. Ensure that you enable shipping cost overrides for all the shipping methods that you set up for your account. For more information, see Automatic Calculation of Shipping Charges (U.S. Merchants Only) or Automatic Calculation of Shipping Charges (non-U.S. Merchants Only).
    • Tax – Enter a percentage to calculate the tax on this item, regardless of quantity.

      The currency for the calculated tax will be the same as the currency for the item. Enter zero (0.000) for non-taxable items to override automatic sales tax calculation on the item.

  11. Choose between your merchant ID and your email address.

    Select one of the following radio buttons to associate transactions from your button with your PayPal account.

    • Secure merchant account ID – Select this radio button to associate your button with your PayPal account by using your merchant ID. PayPal assigns a unique merchant ID to your account and includes it automatically in the code for your button.

      Only PayPal can match your secure merchant ID and PayPal account. When you use a secure merchant ID, your PayPal email address is not exposed in the HTML button code of your webpages.

    • Plain text email – Select this radio button to associate your button with your PayPal account by using your email address. Select from the email addresses in your PayPal account. For example, you might select the email address of the person in your organization who handles order fulfillment or accounting. All payments are deposited to your PayPal account balance, regardless of which email address receives payments from this button. Only confirmed email addresses can be used to receive payments.
    Important: Your email address is a less secure way to associate your button with your PayPal account than by use of your merchant ID. Your email address is exposed on webpages wherever you paste the HTML code for your button.
  12. Do one of the following:

Step 2 – Tracking Inventory With Your Add to Cart Button

Use the Step 2 section of the button creation tool to control whether to save the important details of your button in your PayPal account and to provide inventory tracking information for your item.

For more information, see Tracking Inventory and Tracking Profit and Loss.

  1. Select the Save button at PayPal checkbox to save your button in your PayPal account and to enable your ability to track inventory for your item and to track profit and loss.
  2. Select the Track inventory checkbox to enable entering information that PayPal uses to track inventory for your item. Then, do one of the following:
    • By Item – Select this radio button if you want to track inventory regardless of product options selected by buyers.

      Enter the quantity that you currently have in stock and an alert level. PayPal sends you an alert by email when your inventory on hand falls to or below the alert level.

    • By Option – Select this radio button if want to track inventory by product options that you specified during Step 1 – Specifying Basic Features of Your Add to Cart Button. If you set up product options with prices, the button creation tool automatically selects this radio button.

      For each option listed, enter a unique item ID, the quantity that you currently have in stock, and an alert level. PayPal sends you an alert by email when your inventory on hand for any option falls to or below its alert level.

    Under the Can customers buy an item when it is sold out? heading, do one of the following:

    • Yes – Select this radio button to let buyers checkout and authorize their payments, even when inventory tracking shows that your item would become oversold. Buyers are not informed of oversold or out-of-stock situations nor that their items will be on back order after they complete their transactions.
    • No – Select this radio button to prevent buyers from checking out and authorizing their payments when inventory tracking shows that your item would become oversold. In the text box, enter the URL of a page on your website where you want PayPal to send buyers of out of stock items.

      If there are some items in stock, but not enough to fulfill a buyer's request, PayPal proposes the amount currently available.


      Buyers can click the Update button to accept the proposed quantity, adjust the quantity to a lower number, or click the Remove link to proceed with checkout.

      If there are no items in stock, PayPal lets buyers know that the item is completely sold out.


      PayPal drops sold-out items from the transaction if buyers proceed with checkout.

      "No" is the default choice for this feature.

  3. Select the Track profit and loss checkbox to enable entering information that PayPal uses to track profit and loss for your item. You do not have to track inventory to track profit and loss. If you track inventory, you can track profit and loss only in the same way – either by item or by option.

    If you only track profit and loss and do not track inventory, do one of the following:

    • By Item – Select this radio button if you want to track profit and loss regardless of product options selected by buyers.
    • By Option – Select this radio button if want to track profit and loss by product options that you specified during Step 1 – Specifying Basic Features of Your Add to Cart Button. If you set up product options with prices, the button creation tool automatically selects this radio button and you cannot chnage it.

    Enter the cost to you of your item or for each product option. Include the price that you pay to acquire the item, as well as other activity costs that you incur, such as warehousing, quality control, and administrative overhead.

  4. Do one of the following:

Step 3 – Adding Advanced Features to Your Add to Cart Button

Use the Step 3 section of the button creation tool to specify advanced features of your button.

  1. Can your buyers add special instructions in a message to you (optional)?
    • Yes – Select this radio button to let buyers add special instructions to you during checkout. In the Name of message box text box, enter the text that you want displayed for the text box in which buyers enter their special instructions; the default value is "Add special instructions to the merchant".

      "Yes" is the default choice for this feature.

    • No – Select this radio button if you do not want a text box for special instructions.
  2. Do you need your buyers' shipping addresses (optional)?
    • Yes – Select this radio button to prompt buyers to select or enter shipping addresses during checkout.

      "Yes" is the default choice for this feature.

    • No – Select this radio button if you do not want to prompt buyers for shipping addresses. Select this option for items that do not require shipping, such as digital goods that buyers download, or if the item is a service that does not require on-site delivery.
  3. Take buyers to a specific webpage (URL) after checkout cancellation (optional)?

    Select the checkbox and enter a URL in the text box if you have a special page on your website where you want buyers to return if they cancel their checkouts before completing their transactions.

  4. Take buyers to a specific webpage (URL) after successful checkout (optional)?

    Select the checkbox and enter a URL in the text box if you have a special page on your website where you want buyers to return after they complete their checkouts successfully.

    Note: If you have a special webpage for buyers who return to your website after checking out successfully, consider implementing Payment Data Transfer so that you can display information about the completed transactions.
     
    To learn more, see the Payment Data Transfer webpage on PayPal Developer Network.
  5. Add advanced variables to the HTML code of your payment button (optional).

    If you are familiar with the HTML programming and the advanced HTML variables supported by PayPal Payments Standard payment buttons, you can enter them here. Select the checkbox, and then enter the variables in the text box below it.

    Enter any advanced HTML variables in the following name/value-pair format:

    variableName=allowableValue
    

    For example, if you want to handle purchases as orders rather than as final sales, use the HTML variable paymentaction with the value order. If you were to include the variable in HTML code that you write manually, you would use the standard HTML format:

    <input type="hidden" name="paymentaction" value="order">
    

    Enter the variables in the text box using the shortened, name/value-pair format instead:

    paymentaction=order
    

    Do not enclose values in quotes, even if value contain spaces. PayPal surrounds the value from the equal sign (=) to the end of the line with quotes in the generated HTML code.

    For more information, see HTML Form Basics for PayPal Payments Standard."

  6. Do one of the following:

Copying and Pasting the Add to Cart Code

After you click the Create Button button, PayPal displays the You are viewing your button code page. The page contains tabs with Add to Cart code for specific situations:

  • Website – Copy and paste the HTML button code on this tab onto the pages of your website.
  • Email – Copy and paste the URL email payment link code on this tab into email templates and messages, or paste it onto webpages if your hosting provider does not allow you to paste HTML code.

Regardless of saving your buttons in your PayPal account, you must copy and paste the code that PayPal generates onto your own webpages and into email templates and messages.

Copying and Pasting the HTML Code for the Add to Cart Button

The Website tab on the You are viewing your button code page contains the generated HTML code for your Add to Cart payment button.

If in Step 2 – Tracking Inventory With Your Add to Cart Button you specified that you do not want to save your button in your Paypal account, PayPal protects the generated HTML button code with encryption. Protected HTML code helps secure your buttons against malicious tampering and fraudulent payments.

You can the expose the code of your payment button by clicking the Remove code protection link at the upper right of text box. For example, you might remove protection so that you can edit the code later to change the item price. If you remove code protection, you must use other methods that PayPal recommends to secure your payment button. Click the Protect code link to restore the button protection that you removed.

Important: Merchants with significant payment volume are required to take precautions on securing PayPal Payments Standard buttons.
 
For more information, see Securing Your PayPal Payments Standard Buttons.

To copy and paste the HTML code for your Add to Cart payment button:

  1. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  2. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  3. In your web editing tool, open the webpage where you want the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  4. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

Copying and Pasting the Code for the Add to Cart Email Payment Link

The Email tab on the You are viewing your button code page contains the generated URL code for your Add to Cart email payment link.

Note: PayPal cannot protect the URL code for email payment links. Secure the payments you receive from email payment links by using an alternative method that does not involve encryption, as described in Securing Your PayPal Payments Standard Buttons.

To copy and paste the URL code for your Add to Cart email payment link:

  1. Click the Select Code button on the Email tab to select all of the generated URL code.
  2. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  3. Open the email template or message that you want to send.
  4. Paste the text that you copied from the clipboard into your email, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

Using the Button Creation Tool for a View Cart Button

Each time you create an Add to Cart button, PayPal gives you a chance to create a View Cart button. Paste the same HTML button code onto your webpages for as many View Cart buttons as you need.

  1. Log in to your PayPal Premier or Business account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the My Saved Buttons link.

    The My Saved Buttons page opens.

  4. In the Related Items box on the right, click the Create new button link.

    The Create PayPal payment button page opens.

  5. In the Choose a button type dropdown menu, select "Shopping cart."
  6. Enter the payment details of your item.
    • Item name – Enter any name.
    • Price – Enter any price.
  7. Scroll to the bottom of the page, and click the Step 2 bar.

    The Step 2 – Track inventory, profit and loss (optional) section of the tool expands to fill the page.

  8. Clear the Save button at PayPal checkbox.
  9. Click the Create Button button.

    The You are viewing your button code page opens.

  10. Click the Create a View Cart button link.

    The Create PayPal payment button page opens.

  11. Click the Create button button.

    The You've Created Your Button page opens.

  12. Click the Select Code button on the Websites tab to select all of the generated HTML code.
  13. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  14. In your web editing tool, open the webpage where you want the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  15. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.

Avoiding Problems With Pasted HTML Code

After you paste the HTML code onto your webpage, ensure that it matches exactly the HTML code you copied from PayPal. Pasted code may not match the generated code for the following reasons:

  • You did not copy all of the generated code.
  • Your HTML editing tool may have special areas for pasting HTML code and other areas for pasting display text. Be sure you paste the generated code into a field that accepts HTML code.
  • Your HTML editing tool might change some characters in the pasted code.

Sample HTML Code for Add to Cart Buttons

The sample HTML code in this section demonstrates various features of PayPal hosted Add to Cart buttons:

Important: This section includes unencrypted button code examples for illustrative purposes only. In reality, you must always use encrypted or hosted buttons in your web pages to prevent malicious users from tampering with the code. See Securing Your PayPal Payments Standard Buttons for instructions.

Sample HTML Code for a Basic Add to Cart Button

The sample HTML code below illustrates a basic Add to Cart button with these features:

  • An item named "Birthday - Cake and Candle".
  • An item price of $3.95 USD.
  • PayPal calculates tax and shipping based on rates that you set up in your PayPal account.
  • The buyer's PayPal Shopping Cart opens in a separate browser window or tab.
<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 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.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample HTML Code for Add to Cart Buttons With Product Options

When you add production options to your Add to Cart buttons with HTML code that you write yourself, you can have a maximum of 10 product options, each with their own sets of choices. The options can be either dropdown menus or text boxes. Only one of the dropdown menu options can have options with prices.

Read the following topics for sample code that illustrates various ways to add product options to Add to Cart buttons.

For more information, see Offering Product Options With Add to Cart Buttons.

Sample Code for an Add to Cart Button With Product Options

The sample code below illustrates a basic Add to Cart button with a dropdown menu of product options.

<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 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">

    <!-- Provide a dropdown menu option field, without prices. -->
    <input type="hidden" name="on0" value="Color">Color scheme <br />
        <select name="os0">
            <option
                value="Select a color scheme">-- Select a color scheme --
            <option value="Blue">Blue</option>
            <option value="Pink">Pink</option>
            <option value="Yellow">Yellow</option>
        </select> <br />

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

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:

  • The dropdown menu displays the prices for each option – buyers see the prices they pay for each option.
  • 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:

  • currency_code – sets the currency for option prices
  • item_index – identifies which dropdown menu of product option has prices
  • option_select* and option_amount* – repeats the prices for each option
Note: 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
                value="Select a color scheme">
                -- Select a color scheme --</option>
            <option value="Blue">Blue</option>
            <option value="Pink">Pink</option>
            <option value="Yellow">Yellow</option>
        </select> <br />

    <!-- Provide a dropdown menu option field with prices. -->
    <input type="hidden" name="on1" value="Size">Size <br />
        <select name="os1">
            <option
                value="Select a size">-- Select a size --</option>
            <option value="2x4">2 x 4 - $3.95 USD</option>
            <option value="3x5">3 x 5 - $4.95 USD</option>
            <option value="4x6">4 x 6 - $5.95 USD</option>
        </select> <br />

    <!-- Specify the price that PayPal uses for each option. -->
    <input type="hidden" name="option_index" value="1">
    <input type="hidden" name="option_select0" value="2x4">
    <input type="hidden" name="option_amount0" value="3.95">
    <input type="hidden" name="option_select1" value="3x5">
    <input type="hidden" name="option_amount1" value="4.95">
    <input type="hidden" name="option_select2" value="4x6">
    <input type="hidden" name="option_amount2" value="5.95">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

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 as a Text Box

The sample code below illustrates a basic Add to Cart button with a text box for entering product options.

<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="amount" value="3.95">
    <input type="hidden" name="currency_code" value="USD">

    <!-- Provide the buyer with a text box option field. -->
    <input type="hidden" name="on0"
            value="Size">Enter your size (S, M, L, X, XX) <br />
        <input type="text" name="os0" maxlength="60"> <br />

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

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 HTML Code for Add to Cart Buttons that Open the Shopping Cart in the Merchant Window

By default, when buyers click Add to Cart buttons, the PayPal Shopping Cart opens in a separate browser window.

Figure 10. Opening the PayPal Shopping Cart in the Same Browser Window

You can change the shopping experience for you buyers by opening the PayPal Shopping Cart in the same browser window that displays your website.

Figure 11. Opening the PayPal Shopping Cart in the Same Browser Window

Use the target attribute in the form element to control whether the PayPal Shopping Cart opens in a separate browser window or opens in the same browser window that displays your website.

Table 1. Values for "Target" That Open the PayPal Shopping Cart
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.

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.paypalobjects.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.paypalobjects.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.

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.


If your website has many product pages, browsers may have difficulty returning buyers to the same product pages that they leave when they click your Add to Cart buttons. Returning buyers to a different page, such as the home page of your website, degrades the shopping experience for buyers who want to add more items to their carts before checking out.

Use the shopping_url variable to specify which page PayPal returns buyers to when they click the Continue Shopping button. You can set the value of the shopping_url variable if you know the URL for the webpage where the button appears. In the code below, the merchant wants to ensure that buyers who click an Add to Cart button for a birthday card return to the product page for birthday cards when they want to continue shopping.

<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 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 Card - Cake and Candle">
    <input type="hidden" name="amount" value="3.95">
    <input type="hidden" name="currency_code" value="USD">

    <!-- Continue shopping on the webpage for birthday cards -->
    <input type="hidden" name="shopping_url"
        value="http://www.kinskards.com/birthday_cards">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

With a more advanced coding technique, you can add JavaScript functions to your product pages that get the current URL for the webpage from the browser and uses it as the value of shopping_url. Use this coding technique to make your button code more portable when you copy and paste buttons from webpage to webpage.

...
<script type="text/javascript">
<!--
function getContinueShoppingURL(form){

// -- Get the href of the currently displayed webpage --
form.shopping_url.value = window.location.href;
}
//-->
</script>
...

<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 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 Card - Cake and Candle">
    <input type="hidden" name="amount" value="3.95">
    <input type="hidden" name="currency_code" value="USD">

    <!-- Continue shopping on the current webpage of the merchant site. -->
    <!-- The below value is replaced when buyers click Add to Cart -->
    <input type="hidden" name="shopping_url"
        value="http://www.kinskards.com/birthday_cards">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        onclick=getContinueShoppingURL(this.form)
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

See also Sample HTML Code for View Cart Buttons that Continue Shopping on the Current Merchant Webpage.

Sample HTML Code for Add to Cart Buttons with Discounts

Sample Code for Add to Cart Buttons with a Flat Discount Amount

The sample HTML code below illustrates a basic Add to Cart button with these features:

  • An item named "Birthday - Cake and Candle".
  • An item price of $5.95 USD.
  • A $2.00 discount applies to the item.
  • PayPal calculates tax and shipping based on rates that you set up in your PayPal account.
  • The buyer's PayPal Shopping Cart opens in a separate browser window or tab.
<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 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">

    <!-- Specify the discount amount that applies to the item. -->
    <input type="hidden" name="discount_amount" value="2.00">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample Code for Add to Cart Buttons with Multiple Discount Amounts

The sample HTML code below illustrates a basic Add to Cart button with these features:

  • An item named "Birthday - Cake and Candle".
  • An item price of $5.95 USD.
  • A $0.15 discount applies on the first item; $0.20 on the next 4 items.
  • PayPal calculates tax and shipping based on rates that you set up in your PayPal account.
  • The buyer's PayPal Shopping Cart opens in a separate browser window or tab.
<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 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">

    <!-- Specify the discount amounts that apply to the item. -->
    <input type="hidden" name="discount_amount" value="0.15">
    <input type="hidden" name="discount_amount2" value="0.20">
    <input type="hidden" name="discount_num" value="4">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample Code for Add to Cart Buttons with a Discount Percentage

The sample HTML code below illustrates a basic Add to Cart button that applies a 10% discount. This discount applies only to the first item regardless of the quantity purchased.

<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 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">

    <!-- Specify the discount amount that applies to the item. -->
    <input type="hidden" name="discount_rate" value="10">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample Code for Add to Cart Buttons with Multiple Discount Percentages

The sample HTML code below illustrates a basic Add to Cart button that charges the normal price for the first item and applies a 10% discount for the next 9 items.

<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 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">

    <!-- Specify the discount amounts that apply to the item. -->
    <input type="hidden" name="discount_rate" value="0">
    <input type="hidden" name="discount_rate2" value="10">
    <input type="hidden" name="discount_num" value="9">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample Code for Add to Cart Buttons with a Buy One, Get One Free Discount

The following HTML code uses the discount percentage variables to offer a "Buy one, get one free" discount. To receive the discount, the buyer must purchase two of the item; the second one is free (100% discount).

If the buyer purchases only one of the item, it is the full price. If the buyer purchases more than two, the second one is free and any additional items are full price.

<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 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">

    <!-- Specify the discount amounts that apply to the item. -->
    <input type="hidden" name="discount_rate" value="0">
    <input type="hidden" name="discount_rate2" value="100">
    <input type="hidden" name="discount_num" value="1">

    <!-- Display the payment button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

Sample HTML Code for View Cart Buttons

The sample HTML code in this section demonstrates various features of View Cart buttons:

Important: This section includes unencrypted button code examples for illustrative purposes only. In reality, you must always use encrypted or hosted buttons in your web pages to prevent malicious users from tampering with the code. See Securing Your PayPal Payments Standard Buttons for instructions.

Sample HTML Code for a View Cart Button

View Cart buttons contain no payment information, so you do not need to take on precautions on securing them.

The value for the business variable must match a confirmed email address on file with your PayPal account, and it must match the value that you used for the business variables on your Add to Cart buttons.

<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 a PayPal Shopping Cart View Cart button. -->
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="display" value="1">

    <!-- Display the View Cart button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_LG.gif"
       alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

The sample code above produces the following result:


Paste the code onto the pages of your website wherever you want buyers to click to view the contents of their PayPal Shopping Carts and begin the checkout process.

Sample HTML Code for a View Cart Button That Opens the Shopping Cart in the Merchant Window

By default, when buyers click View Cart buttons, the PayPal Shopping Cart opens in a separate browser window.You can simplify the shopping experience for you buyers by opening the PayPal Shopping Cart in the same browser window that displays the pages of your website.

The sample HTML code below for a View Cart button illustrates how to open the PayPal Shopping Cart in the same browser window as 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 View Cart button. -->
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="display" value="1">

    <!-- Display the View Cart button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_LG.gif"
       alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

For more information, see Sample HTML Code for Add to Cart Buttons that Open the Shopping Cart in the Merchant Window.

Sample HTML Code for View Cart Buttons that Continue Shopping on the Current Merchant Webpage

When buyers click View 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.


If your website has many product pages, browsers may have difficulty returning buyers to the same product pages that they leave when they click your View Cart buttons. Returning buyers to a different page, such as the home page of your website, degrades the shopping experience for buyers who want to add more items to their carts before checking out.

Use the shopping_url variable to let PayPal control which page buyers return to when they click the Continue Shopping button.

<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 a PayPal Shopping Cart View Cart button. -->
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="display" value="1">

    <!-- Continue shopping on the current webpage of the merchant site. -->
    <input type="hidden" name="shopping_url"
        value="http://www.kinskards.com/birthday_cards">

    <!-- Display the View Cart button. -->
    <input type="image" name="submit" border="0"
        src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_LG.gif"
       alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

For more information, see Sample HTML Code for Add to Cart Buttons that Continue Shopping on the Current Merchant Webpage.

Creating PayPal Shopping Cart Buttons with JavaScript Disabled

Getting Started with Add to Cart Buttons With JavaScript Disabled

  1. Log in to your PayPal account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the My Saved Buttons link.

    The My Saved Buttons page opens.

  4. Click the Add to Cart link.

    The PayPal Shopping Cart page opens.

  5. Enter the details of your item.
    • Item name/service – Enter the name of your item or service.
    • Price – Enter a fixed price of your item.
    • Weight – (Optional) Enter the weight of the item. Select Lbs or Kgs from the dropdown menu to specify the unit of measure. If you set up shipping rates for your account with a basis of weight, PayPal uses the value you enter here to calculate shipping charges for orders that include the item.
  6. Scroll to the bottom of the page, and click the Create Button Now button.

    The Add a shopping cart to your site page displays the generated code.

  7. Click the "Add to Cart" button code text box to select all of the generated HTML code.
  8. Do one of the following to copy the selected text to the clipboard:
    • For Windows and Mac, right-click on the code, and then select Copy.
    • For Windows, press Ctrl+C.
    • For Mac, press CMD+C.
  9. In your web editing tool, open the webpage where you want to show the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  10. Do one of the following to paste the text from the clipboard onto your webpage, where you want the button to appear:
    • For Windows or Mac, right-click on the code, and then select Paste.
    • For Windows, press Ctrl+V.
    • For Mac, press CMD+V.

Getting Started with View Cart Buttons With JavaScript Disabled

  1. Log in to your PayPal account at https://www.paypal.com.

    The My Account Overview page opens.

  2. Click the Profile subtab.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the My Saved Buttons link.

    The My Saved Buttons page opens.

  4. Click the Add to Cart link.

    The PayPal Shopping Cart page opens.

  5. Enter the details of your item.
    • Item name/service – Enter a name.
    • Price – Enter a price.
  6. Scroll to the bottom of the page, and click the Create Button Now button.

    The Add a shopping cart to your site page displays the generated code.

  7. Click the "View Cart" button code text box to select all of the generated HTML code.
  8. Do one of the following to copy the selected text to the clipboard:
    • For Windows and Mac, right-click on the code, and then select Copy.
    • For Windows, press Ctrl+C.
    • For Mac, press CMD+C.
  9. In your web editing tool, open the webpage where you want to show the button.
    Important: Be sure that your tool is ready for you to paste HTML code, such as by switching to an HTML view from a design view of your webpage.
  10. Do one of the following to paste the text from the clipboard onto your webpage, where you want the button to appear:
    • For Windows or Mac, right-click on the code, and then select Paste.
    • For Windows, press Ctrl+V.
    • For Mac, press CMD+V.

Creating Advanced Shopping Cart Buttons With JavaScript Disabled

The button creation tool for Add to Cart buttons and View Cart buttons on the PayPal website requires JavaScript. If JavaScript is disabled in your browser, PayPal automatically offers you an alternative button creation tool that does not require JavaScript.

Important: The button creation tool for PayPal Shopping Cart buttons with JavaScript disabled does not support encryption of the code it generates. Secure your button code for Add to Cart buttons by using an alternative strategy described in Securing Your PayPal Payments Standard Buttons." View Cart buttons do not require encryption.

Read the following topics to learn how to create Add to Cart and View Cart buttons with JavaScript disabled.

Note: The alternative tool lets you create Add to Cart buttons on the PayPal website, but it does not allow you to save your buttons in your PayPal account.

The Pages in the Button Creation Tool for Add to Cart

The button creation tool for Add to Cart and View Cart buttons with JavaScript disabled has three pages:

  • PayPal Shopping Cart – the initial page to specify the required and most often used optional features
  • PayPal Shopping Cart – Page 2 – an optional page to specify additional, advanced features, including the button image for View Cart buttons
  • Add a shopping cart to your site – the final page that has the generated code for your payment button

You can switch between the first and second pages until you click the Create Button Now button to display the third page that has the generated code.

Page 1 – Specifying the Basic Features of the Add to Cart Button

To create HTML code for an Add to Cart button and a View Cart button using a tool on the PayPal website with JavaScript disabled:

  1. Log in to your PayPal account at https://www.paypal.com.
  2. Click the Edit Profile link.

    The Profile Summary page opens.

  3. Under the Selling Preferences heading, click the Create New Button link.

    The Create PayPal payment button page opens.

  4. Under the Create button without JavaScript enabled heading, click the Add to Cart link.

    The PayPal Shopping Cart page opens.

  5. Enter the details of your item.
    • Item name/service – Enter the name of your item or service.
    • Item ID/number – (optional) Enter the inventory ID or tracking number of your item. The value you enter is displayed to buyers at the time of payment, and it is displayed in the transaction details that both merchants and buyers can view on the PayPal website.
    • Price – Enter a fixed price of your item.
    • Currency – From the dropdown menu, select the currency in which you priced the item. The dropdown menu automatically selects the currency of your primary balance.

      For more information, see Pricing Items in Multiple Currencies.

    • Buyer's default country – From the dropdown menu, select a country for the PayPal log-in or sign-up page that buyers see when they click the button. The content on the page will be appropriate for the country you select. Buyers can change the country that you select, after the log-in or sign-up page appears.
    • Weight (optional) – Enter the weight of the item. Select Lbs or Kgs from the dropdown menu to specify the unit of measure. If you set up shipping rates for your account with a basis of weight, PayPal uses the value you enter here to calculate shipping charges for orders that include the item.
  6. Choose a button style for your Add to Cart button.

    Select the radio button next to the image that you want to use. The image that you select is hosted by PayPal.


    – or –

    To display your own image that you host on your website:

    • Click the Use your own button image link.

      An additional radio button and text box appear.

    • In the Button Image URL text box, enter the URL of your button image.

      If your image is hosted securely, change the entry to begin with https://.

  7. Specify a shipping method option.
    • Select the Use my shipping calculations radio button if you set up shipping rates for your account and you want the shipping charges for the item to be calculated automatically.

      or

    • Select the Use a flat rate amount radio button if you have not set up shipping rates for your account or you want to exclude the item from automatic calculation of shipping charges.

      In the text box, enter a fixed amount that will be added to the shipping charges for purchases that include the item. Enter zero (0.00) for items that do not incur shipping charges. The currency for the amount that you enter is the same as the currency for the item.

    For more information, see Automatic Calculation of Shipping Charges (U.S. Merchants Only) or Automatic Calculation of Shipping Charges (non-U.S. Merchants Only).

  8. Specify a sales tax option.
    • Select the Use my sales tax calculations radio button if you set up tax rates for your account and you want taxes on the item to be calculated automatically.

      or

    • Select the Use a flat rate amount radio button if you have not set up sales tax calculations for your account or you want to exclude the item from automatic calculation of taxes.

      In the text box, enter a fixed amount that will be added to the taxes for purchases that include the item. Enter zero (0.00) for non-taxable items. The currency for the amount that you enter is the same as the currency for the item.

    For more information, see Automatic Calculation of Sales Tax.

  9. If you have additional details to specify for your button, such as option fields or a custom payment page style that has your own logo and colors, click the Add More Options button and follow the instructions for Page 2 – Adding More Details to the PayPal Shopping Cart Button.

    – or –

    If you entered all the details and options for your button, go to Copying and Pasting PayPal Shopping Cart Code With JavaScript Disabled.

Page 2 – Adding More Details to the PayPal Shopping Cart Button

Use the PayPal Shopping Cart – Page 2 page to specify the following additional details for your button with JavaScript disabled.

  1. Add option fields to your button.

    Option fields lets buyers select or specify options when they purchase the item, such as color or size. Options must not change the price of the item.

    Add to Cart buttons can have one or two option fields. You can use a dropdown menu, with choices that you specify, or a text box, in which buyers type their option choice.

    • Option Field Type – Select either "drop-down menu" or "text box" as the type of option field.
    • Option Name – Enter the name of your option, for example, "Size" or "Color". Enter no more than 60 characters.
    • Drop-Down Menu Choices – (if applicable) If you selected "dropdown menu" as the type of option, enter your menu choices. Choices cannot exceed 30 characters. Use a carriage return (press ENTER) to separate choices. Enter no more than 10 choices.
  2. Choose a button style for your View Cart button.

    Select the radio button next to the image that you want to use. The image that you select is hosted by PayPal.


    – or –

    To display your own image that you host on your website:

    • Click the Use your own button image link.

      An additional radio button and text box appear.

    • In the Button Image URL text box, enter the URL of your button image.

      If your image is hosted securely, change the entry to begin with https://.

      Note: You need to create only one View Cart button for the PayPal Shopping Cart. Place copies of the generated HTML code for the View Cart button wherever you want buyers to click to view their shopping cart and begin the checkout process.
  3. Customize your payment pages.

    Use these settings to give buyers a visually seamless payment experience by customizing the PayPal payment pages to match the visual style of your website.

    • Primary Page Style (display only) – The payment pages that your buyers see are displayed with the page style that is specified here, unless you select a different custom payment page style below.
    • Custom Payment Page Style (optional) – If you already added Custom Payment Page Styles in your account profile, they are listed here. Choose the page style you would like to appear when buyers check out and pay from the PayPal Shopping Cart.

      To learn more about creating page styles, see Co-Branding the PayPal Checkout Pages.

    • Preview – Click the Preview button to see a mock-up of the payment page style that buyers see.
  4. Customize your buyer's experience.

    Use these settings to give buyers a payment experience that is easy to navigate.


    • Successful Payment URL – (optional) Enter the URL for the page on your website that you want buyers redirected to after they complete their payments.

      If Auto Return is off, the button uses the Successful Payment URL that you specify here.

      If Auto Return is on, this field contains the Return URL that you specified when you turned Auto Return on. Click the Edit button to change the Return URL and the Successful Payment URL that this button uses.

      For more information, see Auto Return.

    • Payment Data Transfer – Click the Edit button to turn Payment Data Transfer on or off for all your payment buttons.

      To learn more, see the Payment Data Transfer webpage on PayPal Developer Network.

    • Cancel Payment URL – (optional) Enter the URL for the page on your website that you want buyers redirected to if they cancel their payments at any point in the PayPal Shopping Cart checkout experience. If you do not enter a URL, buyers see a PayPal webpage instead of your webpage. Only this payment button uses the URL that you enter.
  5. Select your shipping preferences.

    Select the radio button that matches your need to collect shipping addresses from buyers:

    Make shipping optional – Select this radio button if you want to prompt buyers to enter their shipping addresses as an option.

    – or –

    Yes, require shipping – Select this radio button if you want to require buyers to enter their shipping addresses.

    – or –

    No shipping needed – Select this radio button if your products do not require shipping, such as digital goods that buyers download, or if your items are services that do not require on-site delivery.

  6. Collect customer notes and special instructions from buyers.

    Use these settings to prompt buyers to enter notes or special handling instructions.


    • Select the Yes radio button if you want buyers to enter notes to you when they make their payments. If you leave the No radio button selected, buyers cannot include notes.
    • Note Title – If you selected the Yes radio button, change the default value for the field label to prompt buyers for specific information, such as their customer IDs or special handling instructions. Enter no more than 30 characters.
  7. Select an email address to receive payment.

    (Optional) In the Email Address dropdown menu, select the email address through which you want to receive payments when people click the payment button that you are creating. The dropdown menu selects your primary email address by default. You might select the email address of the person in your organization who handles order fulfillment or accounting. All payments are deposited to your PayPal account balance, regardless of which email addresses receive particular payments. Only confirmed email addresses can be used to receive payments.

  8. If you want to change any of the details that you entered on the previous page, click the Edit button and follow the instructions for Page 1 – Specifying the Basic Features of the Add to Cart Button, beginning with Step 5.

    – or –

    If you have entered all the details and options for your button, go to Copying and Pasting PayPal Shopping Cart Code With JavaScript Disabled.

Copying and Pasting PayPal Shopping Cart Code With JavaScript Disabled

After you enter the details and options that you want for your Shopping Cart buttons, click the Create Button Now button. PayPal generates HTML code for two PayPal Shopping Cart buttons:

  • An Add to Cart button, which is used for the item you want to sell.
  • A View Cart button, which takes buyers to a webpage hosted by PayPal. This page lists the items that buyers added to their carts and allows them to check out and pay.

The Add a shopping cart to your site page displays the generated code.

Copying and Pasting the HMTL Code for the Add to Cart Button With JavaScript Disabled

  1. Click the "Add to Cart" button code text box to select all of the generated HTML code.
  2. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  3. In your web editing tool, open the webpage where you want the button.
  4. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.
Copying and Pasting the HTML Code for the View Cart Button With JavaScript Disabled

You need to create only one View Cart button, regardless of the number of Add to Cart buttons that you create and add to your website. View Cart buttons on your website let buyers view their shopping carts and the items in them. From there they can proceed to checkout.

  1. Scroll down the Add a shopping cart to your site page to the View Cart Button section.
  2. Click the "View Cart" button code text box to select all of the generated HTML code.
  3. Copy the text that you selected to the clipboard, by:
    • Pressing Ctrl+C.

      – or –

    • Right-clicking your mouse, and selecting Copy.
  4. Open the webpage where you want the button.
  5. Paste the text that you copied from the clipboard onto your webpage where you want the button to appear, by:
    • Pressing Ctrl+V.

      – or –

    • Right-clicking your mouse, and selecting Paste.
Creating More Add to Cart Buttons With JavaScript Disabled

After you copy and paste the PayPal Shopping Cart code, you can create another Add to Cart button for a different item. Scroll to the bottom of the Add a shopping cart to your site page and click the Create Another Button button. Then follow the instructions for Page 1 – Specifying the Basic Features of the Add to Cart Button, beginning with Step 5. The pages of the button creation tool retain the options that you specified previously.

Limitations When Creating Shopping Cart Buttons With JavaScript Disabled

The alternative tool that works with JavaScript disabled lets you create Add to Cart and View Cart buttons on the PayPal website. However, the following features are not supported by the alternative tool:

  • Saving your buttons in your PayPal account
  • Product options with separate pricing for Add to Cart buttons
  • Language choices for buttons images
  • Creating payment buttons before you create your PayPal account

To use any of the above features when creating payment buttons on the PayPal website, enable JavaScript in your browser.

Enabling JavaScript in Your Browser

PayPal recommends that you keep JavaScript enabled at all times. Many features of the PayPal website require thatyou enable JavaScript in your browser.

Read one of the following topics to learn how to enable JavaScript in your browser.

Enabling JavaScript in Internet Explorer

To enable JavaScript in Internet Explorer:

  1. Select Tools > Internet Options from the menu bar.

    The Internet Options dialog box opens.

  2. Click the Security tab.
  3. Select the Trusted sites icon in the box of Web content zones.
  4. Click the Custom level button.

    The Security Settings dialog box opens.

  5. Scroll down to the Scripting section, and then select the Enable radio button as the option for active scripting.
  6. Click the OK button to dismiss the Security Settings dialog box.

    A Warning message box asks if you are sure you want to change the security settings.

  7. Click the Yes button to dismiss the message box.
  8. Click the OK button to dismiss the Internet Options dialog box.

Enabling JavaScript in FireFox

To enable JavaScript in Firefox:

  1. Select Tools > Options from the menu bar.

    The Options dialog box opens.

  2. Select the Content icon at the top of the dialog box.
  3. Select the Enable JavaScript checkbox.
  4. Click the OK button.