View Full Version : How do I get my drop down box to write its information to the shopping cart

09-06-2006, 12:20 AM
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:

09-06-2006, 03:29 AM
The <select> element needs to be in the form with the other <input>s.

09-06-2006, 02:31 PM
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.