Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

Paypal - add multiple item in the cart for checkout

I have a requirement to add multiple items in a paypal cart at the same time and here's how I did it.


<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="czetsuya@gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.czetsuya-tech.blogspot.com">

<input type="text" name="item_name_1" value="Macbook Pro">
<input type="hidden" name="item_number_1" value="001">
<input type="hidden" name="amount_1" value="10">
<input type="hidden" name="quantity_1" value="1">

<input type="hidden" name="item_name_2" value="Asus i7">
<input type="hidden" name="item_number_2" value="002">
<input type="hidden" name="amount_2" value="20">
<input type="hidden" name="quantity_2" value="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!">
</form>


Things you should notice, there are several input tags that have index "_x"
item_name, item_number, amount and quantity.
Paypal - add multiple item in the cart for checkout Paypal - add multiple item in the cart for checkout Reviewed by Edward Legaspi on Tuesday, October 12, 2010 Rating: 5

4 comments:

Anonymous said...

u rock for this, thank you so much

Anonymous said...

what if you want a 0 or '' quantity of something?

paypal doesn't seem to allow this.

mr Miodrag Šljukić said...

Man, you are the best. I lost 3 hours searching internet and found only complicated solutions which I don't need. You explained it in a few words. Thousand thanks!

Anonymous said...

superb!! thanks for this great work.. thanks a million!!

Powered by Blogger.