Cotton Rohrscheib

The Cotton Club Blog & Podcast

  • Home
  • About
    • Timeline
  • Blog
    • Faith & Family
    • Marketing & Tech
    • Farm & Business
    • Entertainment
    • Health & Wellness
    • Urban Farming
    • Weekend Projects
  • Podcast
  • Newsletter
  • Media
    • Photo Galleries
    • Video Archives
  • Marketplace
    • Accoutrements
    • Poshmark
    • Artwork
    • Banknotes & Currency
      • Currency
      • Gold Banknotes
      • Silver Certificates
    • Rare Books
    • Rare Coins
      • Coin Sets
      • Individual Coins
    • Stock Certificates
    • Trading Cards
      • Trading Cards: Autographs
      • Trading Cards: Base
      • Trading Cards: Graded
      • Trading Cards: Raw
      • Trading Cards: Sets
    • Vintage Toys
      • Buddy L
      • Ertl Farm Toys
      • GI Joe
      • Hot Wheels
      • Lionel Trains
      • Marx Toys
      • NASCAR Die-Cast
      • Schleich Toys
      • Star Wars
      • Tonka Trucks
  • Connect
You are here: Home / Blog / Converting to Add to Cart Button (PayPal)

Converting to Add to Cart Button (PayPal)

May 13, 2009 by Cotton Rohrscheib 1 Comment

While talking with a pro bono client today they were wondering how hard it would be to add an “add to cart” button instead of a single item “buy now” button on their site.  At the time their website was developed (approximately 7 years ago) they only offered one item for sale. 

Of course 7 years later they now have 5 items they sell online.  Currently the solution is not setup to add items to cart but after doing a little bit of research today, it’s not hard to covert those… This is an example of what the “single purchase button” is coded…

   1: <form method="post" action="https://www.paypal.com/cgi-bin/webscr">
   2: <input type="hidden" name="cmd" value="_xclick">
   3: <input type="hidden" name="business" value="[email protected]">
   4: <input type="hidden" name="item_name" value="Baseball Hat">
   5: <input type="hidden" name="item_number" value="123">
   6: <input type="hidden" name="amount" value="5.95">
   7: <input type="hidden" name="shipping" value="1.00">
   8: <input type="hidden" name="shipping2" value="0.50">
   9: <input type="hidden" name="handling" value="2.00">
  10: <input type="hidden" name="currency_code" value="USD">
  11: <input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
  12: <input type="hidden" name="undefined_quantity" value="1">
  13: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" width="68" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
  14: </form>

The first step to converting the button is to add this to the form tag:

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

The next thing you will want to do is to locate this line of code:

   1: <input type="hidden" name="cmd" value="_xclick">

and replace it with this:

   1: <input type="hidden" name="cmd" value="_cart">

This line will also need to be added to the form tag:

   1: <input type="hidden" name="add" value="1">

Then you will want to locate the input-type-image area and replace that code with this:

   1: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">

The finished product once you have finished inputting everything and swapping out these snippets of code should look something like this:

   1: <form method="post" action="https://www.paypal.com/cgi-bin/webscr">
   2: <input type="hidden" name="cmd" value="_cart">
   3: <input type="hidden" name="add" value="1">
   4: <input type="hidden" name="business" value="[email protected]">
   5: <input type="hidden" name="item_name" value="Baseball Hat">
   6: <input type="hidden" name="item_number" value="123">
   7: <input type="hidden" name="amount" value="5.95">
   8: <input type="hidden" name="shipping" value="1.00">
   9: <input type="hidden" name="shipping2" value="0.50">
  10: <input type="hidden" name="handling" value="2.00 ">
  11: <input type="hidden" name="currency_code" value="USD">
  12: <input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
  13: <input type="hidden" name="undefined_quantity" value="1">
  14: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
  15: </form>

Fortunately for me the non-profit that was asking about this has now got their in-house IT guy to make the changes, it’s somewhat time consuming and if you only have 5 products or so, you can probably almost generate new add to cart buttons just as fast, which is what I recommended.

 

Creating an Add to Cart button – PayPal

Filed Under: Blog Tagged With: PayPal

About Cotton Rohrscheib

The Cotton Club is a monthly podcast hosted by me, Cotton Rohrscheib. I'm a 52 year old entrepreneur w/ ADHD, OCD (and now AARP) that refuses to grow up as I grow old. I have collaborated and invested in hundreds of projects throughout my career in multiple industries such as; technology, healthcare, and agriculture. I also have 25 years experience in the marketing industry as a co-founder of an award-winning advertising agency. I will undoubtedly cover a wide variety of topics on my podcast while sharing some really crazy stories and situations that I've been fortunate to witness firsthand. I also have a book coming out in 2025 titled, "Mistakes were Made"

Leave a Reply Cancel reply

You must be logged in to post a comment.

  • Email
  • Facebook
  • Instagram
  • LinkedIn
  • Twitter

Recent Updates

  • Products Being Added…
  • Update on the “Cotton Exchange” Marketplace
  • My Review of Monarch Accounting
  • Getting a Late Start in the Garden
  • Online Marketplace Coming Soon!

Blog Categories

  • Blog (434)
  • Entertainment (378)
  • Faith & Family (155)
  • Farm & Business (300)
  • Health & Wellness (37)
  • Marketing & Tech (590)
  • Podcasts (32)
  • Urban Farming (23)
  • Weekend Projects (7)

Blog Archives

Join the Cotton Club!

 

Content Copyright © 2000-2026
Cotton Rohrscheib | Rohrscheib Capital
Disclaimer | Privacy Policy | Account Manager | View Cart

All opinions expressed on this website are 100% Cotton (see my disclaimer). All content, including text, images, and media, are the intellectual property of Rohrscheib Capital unless otherwise noted. To learn how we use your private information, checkout our privacy policy.