Results 1 to 10 of 10

Thread: Help with a simple multiple item Buy It Now option for Paypal

  1. #1
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with a simple multiple item Buy It Now option for Paypal

    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)...

    Code:
    <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?

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Have a look at this page to use paypal's shopping cart.

    https://www.paypal.com/us/cgi-bin/we...o_cart_outside

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #7
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem solved

    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.

  8. #8
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamically give amount values

    I have just one form and want to use dynamic item_name and amount values. Something like this.

    Code:
    <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.
    Last edited by vigneshr35; 12-15-2009 at 05:15 AM. Reason: Spelling error

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,133
    Thanks
    44
    Thanked 3,229 Times in 3,190 Posts
    Blog Entries
    12

    Default

    Sounds like:

    Code:
    <%=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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by johnson1506 View Post
    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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •