Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Add two difference items to shopping card-Paypal

Add two difference items to shopping card-Paypal

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
tutorialcombusinesshelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tktuan
    wrote on last edited by
    #1

    Hi friends ! I need to add two or three difference items with their information but I don't know how to do that. Normal way, to put an item to shopping we just only create the button "Add to card" button and use the code from paypal as bellow.

    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="sampleEmail@domain.com">
    <input type="hidden" name="lc" value="GB">
    <input type="hidden" name="item_name" value="ITEM 001">
    <input type="hidden" name="item_number" value="001">
    <input type="hidden" name="amount" value="1000.00">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="button_subtype" value="products">
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
    <input type="image" src="https://www.paypal.com/en\_GB/i/btn/btn\_cart\_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
    <img alt="" border="0" src="https://www.paypal.com/en\_GB/i/scr/pixel.gif" width="1" height="1">
    </form>

    this code just only put one item to shopping card. Now, for example, i got two difference items with their information : Item one: Item name:Item 001 price :10USD item_number:001 Item two: Item name:Item 002 price :20USD item_number:002 Can anybody help me with sample code to put these two items to paypal shopping card ! Notes: I got these items and their information. I got a Checkout button. Then anybody press to Checkout button, these two items will add to shopping card of Paypal(the result will the same as we click to the "Add to card" button of item one and then continue Shopping and click to the "Add to card" button of item two). Thanks in advance !

    C V 2 Replies Last reply
    0
    • T tktuan

      Hi friends ! I need to add two or three difference items with their information but I don't know how to do that. Normal way, to put an item to shopping we just only create the button "Add to card" button and use the code from paypal as bellow.

      <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <input type="hidden" name="cmd" value="_cart">
      <input type="hidden" name="business" value="sampleEmail@domain.com">
      <input type="hidden" name="lc" value="GB">
      <input type="hidden" name="item_name" value="ITEM 001">
      <input type="hidden" name="item_number" value="001">
      <input type="hidden" name="amount" value="1000.00">
      <input type="hidden" name="currency_code" value="USD">
      <input type="hidden" name="button_subtype" value="products">
      <input type="hidden" name="add" value="1">
      <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
      <input type="image" src="https://www.paypal.com/en\_GB/i/btn/btn\_cart\_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
      <img alt="" border="0" src="https://www.paypal.com/en\_GB/i/scr/pixel.gif" width="1" height="1">
      </form>

      this code just only put one item to shopping card. Now, for example, i got two difference items with their information : Item one: Item name:Item 001 price :10USD item_number:001 Item two: Item name:Item 002 price :20USD item_number:002 Can anybody help me with sample code to put these two items to paypal shopping card ! Notes: I got these items and their information. I got a Checkout button. Then anybody press to Checkout button, these two items will add to shopping card of Paypal(the result will the same as we click to the "Add to card" button of item one and then continue Shopping and click to the "Add to card" button of item two). Thanks in advance !

      C Offline
      C Offline
      cjoki
      wrote on last edited by
      #2

      A simpler method would be to use an associative array, like:... cart[productid] = count; filled in by the add to cart and then have the information sent to the paypal cart with the click of a second button, with a checkout button. The checkout would run a javascript to go through the array and and build the data the way that paypal likes it. Of course there needs to be more involve with a shopping cart, cancel order button, back to shopping button, remove items button, etc, etc....

      T 1 Reply Last reply
      0
      • C cjoki

        A simpler method would be to use an associative array, like:... cart[productid] = count; filled in by the add to cart and then have the information sent to the paypal cart with the click of a second button, with a checkout button. The checkout would run a javascript to go through the array and and build the data the way that paypal likes it. Of course there needs to be more involve with a shopping cart, cancel order button, back to shopping button, remove items button, etc, etc....

        T Offline
        T Offline
        tktuan
        wrote on last edited by
        #3

        Hi ! Thanks for your reply , but that is not what i need. IF your couldn't understand my question, im sorry because my english. My question is: How to send data to paypal after we got information. For Example, to send one item we use this code bellow.

        <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_cart">
        <input type="hidden" name="business" value="sampleEmail@domain.com">
        <input type="hidden" name="lc" value="GB">
        <input type="hidden" name="item_name" value="ITEM 001">
        <input type="hidden" name="item_number" value="001">
        <input type="hidden" name="amount" value="1000.00">
        <input type="hidden" name="currency_code" value="USD">
        <input type="hidden" name="button_subtype" value="products">
        <input type="hidden" name="add" value="1">
        <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
        <input type="image" src="https://www.paypal.com/en\_GB/i/btn/btn\_cart\_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
        <img alt="" border="0" src="https://www.paypal.com/en\_GB/i/scr/pixel.gif" width="1" height="1">
        </form>

        this code just only put one item to shopping card. In my question i 'd like to send to shopping cart(paypal shopping card) two difference items with their information : Item one: Item name:Item 001 price :10USD item_number:001 Item two: Item name:Item 002 price :20USD item_number:002 Have any ideas? Thanks in regards

        C 1 Reply Last reply
        0
        • T tktuan

          Hi ! Thanks for your reply , but that is not what i need. IF your couldn't understand my question, im sorry because my english. My question is: How to send data to paypal after we got information. For Example, to send one item we use this code bellow.

          <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
          <input type="hidden" name="cmd" value="_cart">
          <input type="hidden" name="business" value="sampleEmail@domain.com">
          <input type="hidden" name="lc" value="GB">
          <input type="hidden" name="item_name" value="ITEM 001">
          <input type="hidden" name="item_number" value="001">
          <input type="hidden" name="amount" value="1000.00">
          <input type="hidden" name="currency_code" value="USD">
          <input type="hidden" name="button_subtype" value="products">
          <input type="hidden" name="add" value="1">
          <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
          <input type="image" src="https://www.paypal.com/en\_GB/i/btn/btn\_cart\_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
          <img alt="" border="0" src="https://www.paypal.com/en\_GB/i/scr/pixel.gif" width="1" height="1">
          </form>

          this code just only put one item to shopping card. In my question i 'd like to send to shopping cart(paypal shopping card) two difference items with their information : Item one: Item name:Item 001 price :10USD item_number:001 Item two: Item name:Item 002 price :20USD item_number:002 Have any ideas? Thanks in regards

          C Offline
          C Offline
          cjoki
          wrote on last edited by
          #4

          Sound like you want method 2, found here https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_howto_checkout_outside[^]

          T 1 Reply Last reply
          0
          • C cjoki

            Sound like you want method 2, found here https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_howto_checkout_outside[^]

            T Offline
            T Offline
            tktuan
            wrote on last edited by
            #5

            Dear cjoki ! Thanks for your reply. This is what i need. When i was waiting for your reply, i found another way to post items to paypal shopping card as following scribe bellow: -Using client script(js) to post each form. But this is not better than the way that you tell me.

            for(var i=0;i

            Thanks in advance !

            modified on Wednesday, December 30, 2009 9:26 PM

            1 Reply Last reply
            0
            • T tktuan

              Hi friends ! I need to add two or three difference items with their information but I don't know how to do that. Normal way, to put an item to shopping we just only create the button "Add to card" button and use the code from paypal as bellow.

              <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
              <input type="hidden" name="cmd" value="_cart">
              <input type="hidden" name="business" value="sampleEmail@domain.com">
              <input type="hidden" name="lc" value="GB">
              <input type="hidden" name="item_name" value="ITEM 001">
              <input type="hidden" name="item_number" value="001">
              <input type="hidden" name="amount" value="1000.00">
              <input type="hidden" name="currency_code" value="USD">
              <input type="hidden" name="button_subtype" value="products">
              <input type="hidden" name="add" value="1">
              <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
              <input type="image" src="https://www.paypal.com/en\_GB/i/btn/btn\_cart\_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
              <img alt="" border="0" src="https://www.paypal.com/en\_GB/i/scr/pixel.gif" width="1" height="1">
              </form>

              this code just only put one item to shopping card. Now, for example, i got two difference items with their information : Item one: Item name:Item 001 price :10USD item_number:001 Item two: Item name:Item 002 price :20USD item_number:002 Can anybody help me with sample code to put these two items to paypal shopping card ! Notes: I got these items and their information. I got a Checkout button. Then anybody press to Checkout button, these two items will add to shopping card of Paypal(the result will the same as we click to the "Add to card" button of item one and then continue Shopping and click to the "Add to card" button of item two). Thanks in advance !

              V Offline
              V Offline
              vorotnik
              wrote on last edited by
              #6

              http://phpforms.net/tutorial.html[^]This tutorials for working with different php forms. And PayPal forms too.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups