• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Storefronts and Shopping Carts > 46. Create Shopping Cart Links

Create Shopping Cart Links

Convert Shopping Cart button code to single-line URLs that can be emailed or linked to images.

Although you can create Shopping Cart buttons [Hack #45] at the PayPal web site, you can also create buttons off-site. This gives web page designers more flexibility and gives programmers the ability to create buttons dynamically with programming code. One of the simplest and most flexible approaches involves creating URLs instead of HTML forms.

The Code

The HTML code for a simple Add to Cart button looks like this:

<form method="post" action="https://www.paypal.com/cgi-bin/webscr"
                target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="pay@paypalhacks.com">
<input type="hidden" name="item_name" value="PayPal Hacks">
<input type="hidden" name="amount" value="24.95">
<input type="submit" name="add" value="Add to Cart">
</form>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint