Log in

View Full Version : Help with a simple multiple item Buy It Now option for Paypal



Mark__G
01-31-2008, 10:24 PM
So I have a page set up for a customer who doesn't want to set up a shopping cart program, but rather just a simple straight forward page with multiple items for sale all on one page.

I am trying to figure out how to post to paypal's secure order form with multiple items and values since all the codes they reference are sending the item name and the value as a hidden value within a single form so it wouldn't work for multiple items.

My solution was this (not working)...



<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="ACCOUNT@EMAIL.COM">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="weight" value="1">
<input type="hidden" name="weight_unit" value="lbs">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">

<a href="https://www.paypal.com/cgi-bin/webscr?item_name=ITEM1&amp;amount=10" onclick="document.['form1'].submit(); return false">ITEM1</a>

<a href="https://www.paypal.com/cgi-bin/webscr?item_name=ITEM2&amp;amount=20" onclick="document.['form1'].submit(); return false">ITEM2</a>

<a href="https://www.paypal.com/cgi-bin/webscr?item_name=ITEM3&amp;amount=30" onclick="document.['form1'].submit(); return false">ITEM3</a>


</form>


So ya that doesn't work, just wondering if anyone had any ideas on trying to get this to work?

thetestingsite
01-31-2008, 10:44 PM
Have a look at this page to use paypal's shopping cart.

https://www.paypal.com/us/cgi-bin/webscr?cmd=_pdn_xclick_to_cart_outside

Hope this helps.

Mark__G
01-31-2008, 11:22 PM
In that example the amount and item name are still being passed as hidden values so you can't have more than one item on a page with the paypal add to cart or buy it now function.

thetestingsite
01-31-2008, 11:27 PM
Yes, but you use that form for every product and it will add it into the shopping cart. After the user is satisfied with the selections, they can choose to checkout (and then that process will start).

Hope this helps.

Mark__G
02-01-2008, 12:51 AM
If possible I am trying to take out the whole view cart method, just re-direct to paypal with an item name and price that is set for each item on the page.

thetestingsite
02-01-2008, 02:55 PM
Ok, I must have misunderstood your first post. You want to have a buy it now button for each item, and that's it? If so, you already have the code, simply repeat that form. If you want multiple items, you will need to have some sort of shopping cart for it.

Hope this helps.

johnson1506
02-28-2009, 12:47 AM
Hi,

Did you sort your problem out I wanted to achieve the same, and I have created the code for it, I can now submit multiple items to paypal without having a shopping cart system.

James.

vigneshr35
12-15-2009, 05:14 AM
I have just one form and want to use dynamic item_name and amount values. Something like this.


<input type="hidden" name="item_name" value="<%=levelChosen%>">
<input type="hidden" name="amount" value="<%=levelAmount%>">

I am able to see the item name correctly in the PayPal check out page. But the amount is showing as 0.00 USD and the text box for user to enter the amount and click on the Update total.

But I want the total cost to be the dynamic value that I have mentioned here, thereby want to prevent prompting the user to enter the amount value. How can I do this. I have created the buy Now button using my Business Account in PayPal.

jscheuer1
12-15-2009, 05:25 AM
Sounds like:


<%=levelAmount%>

is resolving to an unexpected value. It should be in the form of dollars.cents, example:

10.00

You can see how that is being served by navigating to your live form via selecting something that should generate a <%=levelAmount%>, then using the browser's 'view source' to see what value your server has placed there.

richtrix
09-28-2010, 02:19 AM
Hi,

Did you sort your problem out I wanted to achieve the same, and I have created the code for it, I can now submit multiple items to paypal without having a shopping cart system.

James.
Hi Johnson1506,

How are you able to accomplish what you said above... I know this was a while ago that you posted this. I have multiple upsell pages which just go along like a choose your own adventure branching out depending on the upsells they choose. I have a page for every possible course. At the end I want to be able to submit the multiple items they've chosen. I don't want any add to cart crap which makes them "return to shopping" at paypal. Now I just have pre configured buttons for every possible choice so the checkout page is not itemized. It is just one item for the total amount of multiple items. I cannot figure out how to submit multiple items with the click of one button though. If you've done this could you share the magic?

Thanks so much,
Sincerely,
Rich Clarke