Shopping Cart Tutorial – How to Make a Shopping Cart with Paypal Checkout

Jun 07, 2012, by admin

paypalPaypal makes it very simple to make a shopping cart on your website. I will show you two ways to do it, first the simple way and then the more secure (but really not that hard either) way. Paypal makes money by charging  a small percentage of the purchase price. They withhold that automatically from the payment, so that’s easy as well. The only requirement is that if your monthly sales are more than $3000 US you have to apply for a merchant account. After your merchant account is approved, the rates drop the more you sell.

paypal_checkout_buttonBut first, there is some information you need to know in order to set up your Paypal Shopping Cart:

Paypal shopping cartPaypal Shopping Cart Requirements

A Paypal account

If you don’t have a Paypal account, go to Paypal and sign up for one. Use an email address you want associated with your shopping cart. The best is to use an address that is on the domain of your website, but it’s not required.

Something to sell

You’ll need to know the item’s name, price, and optionally shipping costs and tax rate.

A website

This can be any website at all, from a personal page to a specialized domain

An HTML editor

So that you can add your shopping cart to the page

The Simple Way to Set Up a Paypal Shopping Cart

The simple way to set up a Paypal shopping cart is to copy the HTML following code where you want the “Buy Now” button.

<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>

<input type=”hidden” name=”cmd” value=”_xclick”>

<input type=”hidden” name=”business” value=”PAYPAL EMAIL ADDRESS”>

<input type=”hidden” name=”lc” value=”US”>

<input type=”hidden” name=”item_name” value=”ITEM FOR SALE”>

<input type=”hidden” name=”amount” value=”PRICE”>

<input type=”hidden” name=”currency_code” value=”USD”>

<input type=”hidden” name=”button_subtype” value=”products”>

<input type=”hidden” name=”bn” value=”PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted”>

<input type=”image” src=”https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif”

border=”0″ name=”submit” alt=”PayPal – The safer, easier way to pay online!”>

<img alt=”” border=”0″ src=”https://www.paypal.com/en_US/i/scr/pixel.gif” width=”1″ height=”1″>

</form>

 Change the three bold items to your values, particularly:

PAYPAL EMAIL ADDRESS – the address you receive paypal funds from

ITEM FOR SALE – a short description or title of the item for sale

PRICE – Do not add the dollar-sign, and do add the pennies, even if it’s an even number (ie. 800.00 – not $800) The price will be in US dollars.

You can put that form on every page that you want to sell something, just change the price and description

The Best Way to Set Up a Paypal Shopping Cart

Paypal CheckoutWhile it’s very simple to put the above code anywhere you want to sell something, there are some problems with doing it that way:

  1. Your Paypal email address is written in clear text in your HTML – wide open for spammers to harvest
  2. It is just one button, “Buy Now”, there are no other options
  3. You don’t have any options for price and options on what you’re selling
  4. And lots of other options

To solve this, you should go to Paypal directly. They have a button designer you can use to

For security reasons, I don’t recommend clicking on any link directly into Paypal, even if you trust the source. Instead, you should type in http://www.paypal.com into your browser window, and navigate to the button designer directly:

  1. Go to http://www.paypal.com/
  2. Mouse over the “Get Paid” option in the menu and then click on “Accept Credit Cards”
  3. Click on the “Setting Up” tab
  4. Click on “set up your button”

 Once you’re in the button builder you can customize lots of options on your form, including:

  1. Change it to an “add to cart” button so that customers can shop for multiple items
  2. Accept donations, set up subscriptions, or sell gift certificates
  3. Use item IDs to have Paypal help you with your inventory (with a Paypal business account)
  4. Change currencies or set up multiple prices (for different sizes or options)
  5. Add in shipping fees and taxes
  6. Most importantly have Paypal use a Merchant ID for your transactions, so your email address is secure.
  7. Customize checkout pages (with a Paypal business account)
  8. And lots of other options

Once you’re done choosing your options, click on the “Save Changes” button. Then just paste the code that is generated into your HTML editor where you want the button.