View Full Version : PayPal Buy Now Buttons
techlinks
12-4-07, 08:44 AM
Hello:
I own a web site named "www.massagecenters.com" and I'd like to offer a few products, 2-4 to sell online in time for this holiday season. While I'm comfortable using the PayPal "make buy now button" feature, I'd like to know how to dynamically generate the form data. Here's why. The products I sell will rotate every week. So I want to add products freely to my catalog and when I make them available for sale online, I need the Buy Now buttons to work for each unique product. It seems I have to create Buy Now buttons manually for each product in advance (at least that's how it looks online). Is there a solution to do this dynamically? Such as, use a buy now button but dynamically insert the product code, price, etc?
Thanks
Techlinks
techlinks
12-4-07, 09:00 AM
Hi folks...here's an example of what I mean. I created the following code on PayPal
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHVwYJKoZIhvcNAQcEoIIHSDCCB0QCAQExggEwMIIBLAIBAD C
etc. etc. etc.
-----
">
</form>
But I'd like to be able to change the item name, item ID and price. That's because I have a catalog that I'd be maintaining once a week and I don't want my customer to keep returning back to me asking for new PayPal button code. Hope this makes sense.
Thanks
Techlinks
YvetteKuhns
12-4-07, 03:53 PM
You could create an array to define each item name, item ID and price. You can add or delete items from the array and use a loop to list each item that has a not null value for the item name. You will want to skip null values (the items that are deleted from your list), but you don't need to worry about renumbering the items in the array.
entrecon
12-4-07, 04:39 PM
Been a while since I have done this, but I had the products in a database and generated the buttons based on the value retrieved from the database.
techlinks
12-4-07, 06:16 PM
YvetteKuhns and entrecon:
Thank you for your feedback. Using some of the keywords you mentioned, I ran a meta search with www.dogpile.com and stumbled upon the following solution:
http://blog.jc21.com/2006-06-12/paypal-button-generator/
It's a PHP class that dynamically creates buttons on demand. Thought I'd share with the community; seems like a pretty nifty tool. I put a sample of the script here:
http://test.techlinks.com/dynamic/example.php
Thanks again everyone.
techlinks
12-4-07, 06:22 PM
I ran a meta search with www.dogpile.com and stumbled upon the following solution:
http://blog.jc21.com/2006-06-12/payp...ton-generator/
It's a PHP class that dynamically creates buttons on demand. Thought I'd share with the community; seems like a pretty nifty tool. I put a sample of the script here:
http://test.techlinks.com/dynamic/example.php
Thanks again everyone.
You could also integrate a shopping cart script that accepts paypal as a payment possessor, and once you add the products to your shopping cart, everything else is handled for you
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.