www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 03-06-2007, 11:42 AM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    paypal cart

    Ok Im working on a paypal cart for a client of mine. Now the cart already was on his site he just needs me to make some alterations and to show and hanlde more options in the cart. I have never done a cart before and this is ofcourse my first ever paypal cart. Here is what I have for code so far.
    PHP Code:
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="numberplate1">
                  <
    table>
                    <
    tr>
                      <
    td><input type="hidden" name="on0" value="Bike">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Bike</font></font></td>
    <
    td> <select name="os0" class="bikes" id="bike0" onchange="selectBikeModel(this.options[this.selectedIndex], this.id);">
                              <
    option value="-Select Bike-">-Select Bike-</option>
                            <
    option value="Cobra">Cobra</option>
                            <
    option value="Honda">Honda</option>
                            <
    option value="KTM">KTM</option>
                            <
    option value="Kawasaki">Kawasaki</option>
                            <
    option value="Suzuki">Suzuki</option>
                            <
    option value="Yamaha">Yamaha</option>
                            </
    select>
                      </
    td>
                    </
    tr>
                     <
    tr>
                      <
    td><input type="hidden" name="on1" value="Year">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Year</font></font></td>
                      <
    td><select name="os1" id="years0" class="bikeYears">
                      </
    select>
                      </
    td>
                    </
    tr>
                    <
    tr>
                      <
    td><input type="hidden" name="on2" value="Model">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Model</font></font></td>
                      <
    td><select name="os2" id="bike0model" >
                      <
    option value="-Select Model-">-Select Model-</option>
                      </
    select>
                      </
    td>
                    </
    tr>
                    <
    tr>
                      <
    td><input type="hidden" name="on3" value="Stripe Color">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Stripe Color</font></font></td>
                      <
    td><select name="os3">
                      <
    option value="Apple Green">Apple Green</option>
                      <
    option value="Atomic Red">Atomic Red</option>
                      <
    option value="Brick Red">Brick Red</option>
                      <
    option value="Cobalt Blue">Cobalt Blue</option>
                      <
    option value="Dark Green">Dark Green</option>
                      <
    option value="Intense Blue">Intense Blue</option>
                      <
    option value="Lemon Yellow">Lemon Yellow</option>
                      <
    option value="Purple">Purple</option>
                      <
    option value="Lime Green">Lime Green</option>
                      <
    option value="Olympic Blue">Olympic Blue</option>
                      <
    option value="Orange">Orange</option>
                      <
    option value="Silver">Silver</option>
                      <
    option value="Intense Red">Intense Red</option>
                      <
    option value="Navy Blue">Navy Blue</option>
                      <
    option value="Magenta">Magenta</option>
                      <
    option value="White">White</option>
                      </
    select>
                      </
    td>
                    </
    tr>
                    <
    tr>
                      <
    td><input type="hidden" name="on4" value="Background Color">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Background Color</font></font></td>
                      <
    td><Select name="os4">
                      <
    option value="Yellow">Yellow</option>
                      <
    option value="White">White</option>
                      <
    option value="Black">Black</option>
                      </
    select>
                      </
    td>
                    </
    tr>
                    <
    tr>
                      <
    td><input type="hidden" name="on5" value="Number">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Number</font></font></td>
                      <
    td><input type="text" name="os5" maxlength="200"></td>
                    </
    tr>
                    <
    tr>
                      <
    td><input type="hidden" name="on6" value="Front Name">
                        <
    font size="2"><font face="Arial, Helvetica, sans-serif">Front Name</font></font></td>
                      <
    td><input onclick="this.value='';" value="Name Here" type="text" name="os6" maxlength="200"></td>
                    </
    tr>
                  </
    table>
                  <
    input type="hidden" name="upload" value="1">
                  <
    input type="hidden" name="cmd" value="_cart">
                  <
    input type="hidden" name="business" value="staff@4mxgraphics.com">
                  <
    input type="hidden" name="item_name_1" value="Standard Numberplate Kit">
                  <
    input type="hidden" name="item_number_1" value="NX 100">
                  <
    input type="hidden" name="amount_1" value="49.95">
                  <
    input type="hidden" name="no_shipping" value="2">
                  <
    input type="hidden" name="return" value="http://www.4mxgraphics.com">
                  <
    input type="hidden" name="currency_code" value="USD">
                  <
    input type="hidden" name="lc" value="US">
                  <
    input type="hidden" name="bn" value="PP-ShopCartBF">
                  <
    input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
                </
    form>
    Now the link I am using to try to figure out what I need to do is here.
    https://www.paypal.com/cgi-bin/websc...eckout-outside
    Now my problem is that when you view the cart it only shows 2 of the options you selected. those being Bike and year but nothing else. So what else do I need to do for EVERYTHING to show in the cart. I have tried a number of things and no success yet.

    Thank you all for the help.
    Reply With Quote
      #2  
    Old 03-07-2007, 10:00 AM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Anyone have any ideas at all?
    Reply With Quote
      #3  
    Old 03-08-2007, 12:38 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Does anyone in here have experiance with paypal carts or know what it is that I need to do with my code to get this working?
    Reply With Quote
      #4  
    Old 03-08-2007, 04:01 PM
    michael879 michael879 is offline
    Registered User
     
    Join Date: Jan 2007
    Posts: 187
    you havnt posted any php code... what exactly do you need help with?
    Reply With Quote
      #5  
    Old 03-08-2007, 04:42 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Well the code I have posted above you can see names of everything along with the stuff at the bottom of the script. My problem is that from what I can tell I have gone by the guidlines on the link I also posted above and for some reason the cart only displayes the first two options on my pages rather then all of the options. So Im trying to see if anyone knows where I went wrong or how to fix this.
    Reply With Quote
      #6  
    Old 03-08-2007, 05:44 PM
    michael879 michael879 is offline
    Registered User
     
    Join Date: Jan 2007
    Posts: 187
    before I step through every line of your code, what do you mean by options? Do you literally mean the <option> tags or do you mean the <select> boxes?
    Reply With Quote
      #7  
    Old 03-08-2007, 06:06 PM
    Taschen's Avatar
    Taschen Taschen is offline
    HaHaBoink
     
    Join Date: Sep 2006
    Location: Europe
    Posts: 174
    Unfortunately the PayPal cart doesn't accept more than two options [on0 and on1]. However, you could do what osCommerce does with it's paypal plug in and post only the total of your own cart to paypal. (I.e use a seperate shopping cart from paypal and post the total from that cart to paypal).

    The advantages of using your own cart: You determine all of the variables.
    The disadvantages: Only the cart total and not the cart contents are posted to paypal. Consequently there is a loss of Paypal functionality (eg cart content details not sent to customer by paypal, only cart total).
    __________________
    HaHaBoink
    electro-osho | terramar.co.uk
    Reply With Quote
      #8  
    Old 03-08-2007, 07:36 PM
    michael879 michael879 is offline
    Registered User
     
    Join Date: Jan 2007
    Posts: 187
    you could probably write a php script that loops through the options sending each one individually to paypal. this would mean paypal would have to accept get variables tho. Maybe theres a way to do it with javascript.
    Reply With Quote
      #9  
    Old 03-08-2007, 08:52 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Quote:
    before I step through every line of your code, what do you mean by options? Do you literally mean the <option> tags or do you mean the <select> boxes?
    Sorry, I mean the select boxes. From what I understand in the link, paypal calls them options.

    Quote:
    you could probably write a php script that loops through the options sending each one individually to paypal. this would mean paypal would have to accept get variables tho. Maybe theres a way to do it with javascript.
    How would I writ this up? Im still new to PHP so I admit, I would need as much help with it as possable and js I have only dabeled in a little bit.

    Quote:
    The advantages of using your own cart: You determine all of the variables.
    The disadvantages: Only the cart total and not the cart contents are posted to paypal. Consequently there is a loss of Paypal functionality (eg cart content details not sent to customer by paypal, only cart total).
    So there is no way what so ever to get more info to display into the cart?
    I guess bottom line is realy it doesnt matter totaly that "EVERYTHING" has to show in the cart. As it is right now the bike make and year show in it, but if there is a way I could have those two things along with the rest of the "options" for a customers order be mailed to my client, that would work perfectly. Any ideas how this could be done?

    Thank you all so much for your help. I greatly appreciate it
    Reply With Quote
      #10  
    Old 03-09-2007, 10:29 AM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    any of you have any ideas on this?

    Thank you
    Reply With Quote
      #11  
    Old 03-09-2007, 01:38 PM
    1andyw 1andyw is offline
    Registered User
     
    Join Date: Mar 2006
    Posts: 67
    Crazy8,

    Have you explored the PayPal development center? They maintain a testing environment called 'Sandbox'. You write your scripts and 'test' them online. There is a detailed pdf 'User Guide' available at that site.

    https://www.paypal.com/IntegrationCe...c_pdnHome.html

    Andy
    Reply With Quote
      #12  
    Old 03-09-2007, 04:24 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    I will surely check that out. Anyone have any answers for my last post?

    Thank you guys and/or gals for all your help
    Reply With Quote
      #13  
    Old 03-15-2007, 02:35 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Taschen

    Well if I could either build my own cart or use a nice 3rd party one (if you know of any good ones let me know) as long as the cart displayed the contents and the total and only paypal displayed the total, even that would work just fine. Im on a REALY tight schedual now so Im kinda scrambling and trying to find a solution. I did look at some 3rd party ones (free of course) but not sure what to do or what to use. any ideas, suggestions, or help would be GREATLY appreciated.
    Reply With Quote
      #14  
    Old 03-18-2007, 11:58 PM
    crazy8 crazy8 is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 90
    Well I have done some research. Would zencart be a good choice or could that be over kill? All I really need is something that will display everything I need it to which is just stuff in text boxes and drop downs, and it should support paypal. Otherwise I just need something simple and easy to configure and install. What are all of your thoughts? any recomendations of a cart that would "fit the bill" for what I need? I really dont need something huge and fancy.
    Reply With Quote
      #15  
    Old 03-20-2007, 05:36 PM
    Taschen's Avatar
    Taschen Taschen is offline
    HaHaBoink
     
    Join Date: Sep 2006
    Location: Europe
    Posts: 174
    Quote:
    Originally Posted by crazy8
    any recomendations of a cart that would "fit the bill" for what I need? I really dont need something huge and fancy.
    I've only tried oscommerce which has a paypal plugin. It is a complete ecommerce solution and could take a few days to configure. The upside is that there are lots of plugins (eg for loading excel sheets etc.) It is also well supported and bugs tend to be fixed quickly. I understand that Zen cart is a similar product.

    Sorry that I can't help more than that.
    __________________
    HaHaBoink
    electro-osho | terramar.co.uk
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:40 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.