Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PayPal "Button" NewB question

Status
Not open for further replies.

irbk

MIS
Oct 20, 2004
578
US
This is the code provided to you from paypal if you want to use paypal as a shopping cart.
Code:
<form target="paypal" action="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr"[/URL] method="post">
<input type="image" src="[URL unfurl="true"]https://www.paypal.com//en_US/i/btn/x-click-but22.gif"[/URL] border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="[URL unfurl="true"]https://www.paypal.com/en_US/i/scr/pixel.gif"[/URL] width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="email@email.com">
<input type="hidden" name="item_name" value="[b]Test[/b]">
<input type="hidden" name="item_number" value="[b]Testitem[/b]">
<input type="hidden" name="amount" value="[b]0.01[/b]">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form
Here is my question,
Do you HAVE to go through paypal's website, and hard code each button for each item on your website? Or, can you use variables in the button more like (NOTE: For ease of reading, I bolded the different items between the two code blocks.)
Code:
<form target="paypal" action="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr"[/URL] method="post">
<input type="image" src="[URL unfurl="true"]https://www.paypal.com//en_US/i/btn/x-click-but22.gif"[/URL] border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="[URL unfurl="true"]https://www.paypal.com/en_US/i/scr/pixel.gif"[/URL] width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="email@email.com">
<input type="hidden" name="item_name" value="[b]$Item_Name[/b]">
<input type="hidden" name="item_number" value="[b]$Item_Number[/b]">
<input type="hidden" name="amount" value="[b]$Cost[/b]">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>

If you can use the variables, I can really see the benifit of this. If you can't, and have to hard code each button.... Oy, that would be painfull.

Thanks in advance!
 
No, you can absolutely do this. Just put this code with variables in a separate file and include in each of your pages (with variables defined first!)
 
Sweet. Good to know that I can use the same code and just pass the correct information in Variables.

Now, another question along the same lines. I've been told that paypal may not be the best choice to make because it looks "unprofessional" and because paypal pressures you so much to sign up. Was even told a story how one web site had over a 50% cancel rate when the customer got to the paypal checkout. What are your thoughts/feelings on this?
 
That's a matter of opinion really. I suggested it to a recent client, and they thought the notion of no setup/recurring fees and easy checkouts were pretty attractive.

I'm sure the folks at webmasterworld.com have discussed the merits of PayPal at some, if not a few, points. Try a search there for more opinions.

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top