Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Thanked 0 Times in 0 Posts

    Question How do I get my drop down box to write its information to the shopping cart

    I am building an E commerce website and have a product that has different colors. I have a drop down box that lists the colors in it but I cannot get it to carry the color selected to my pay pal shopping cart

    Here is the code for the drop down box

    <form name="color"><div align="left">
    <select name="select1" size="1">

    And here is the code for the shopping cart button

    <Form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="brett@gardendiscounters.com">
    <input type="hidden" name="item_name" value="Round 360 Chiminea">
    <input type="hidden" name="item_number" value="00312">
    <input type="hidden" name="amount" value="184.99">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="shipping" value="">
    <input type="hidden" name="shipping2" value="">
    <input type="hidden" name="handling_cart" value="">
    <input type="hidden" name="bn" value="ButtonFactory.Tripod.001">
    <input type="image" name="add" src="https://www.paypal.com/images/x-click-but22.gif">

    Any help would be greatly appreciated:

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Thanked 0 Times in 0 Posts
    The <select> element needs to be in the form with the other <input>s.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    Regular Coder
    Join Date
    Sep 2005
    Thanked 0 Times in 0 Posts
    Although Kravvitz is correct in that to get a form-element submitted, it would need to be in the same form as the rest of the elements, in this particular instance I don't think the fix is that easy... The form is being submitted to paypal and I don't think paypal would understand how to process 'select1'.

    I haven't worked with paypal so I don't know what kind of info. they expect to recieve from a form submitted to them... Is the item_number an arbitrary number that you provide to Paypal, or do they assign your product a number? If you are the one picking the number, then I'd use a different item_number for each color...

    <Form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
    <!-- ... other form-elements here ... -->
    <select name="item_number" size="1">
    <option value="00312">Black</option>
    <option value="00313">Bronze</option>
    <option value="00314">Green</option>
    <option value="00315">Pewter</option>
    <input type="image" name="add" src="https://www.paypal.com/images/x-click-but22.gif">
    Similarly, instead of changing the entire number, you could tack on a letter to distinguish each item (eg "00312-bl", "00312-br", "00312-gr", "00312-pw" respectively) Many clothing catalogues use similar practices when some small attribute distugishes among different item types (eg size, color, cut).

    If, on the other hand, Paypal is assigning the item_number to you, then you may need to see if Paypal accepts other fields. For example, Paypal may have an "features" field where you can input additional attributes for the item being ordered. Alternatively, you may be able to tack on the color description onto the item_name, as long as Paypal doesn't use the item_name for anything more than just a mere descriptor. As a last resort, you may need to make each color a different item, having Paypal assign 4 different item_numbers.
    If you want answers, write a smart question.

    Yes, someone probably does know how...

    Oh, and if you want to learn, STFW!


    Posting Permissions

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