Add to Cart Button with Options Help

gergs11
Contributor
Contributor

Hi, I'm having trouble with an Add to Cart button that has product options/variations. The form works without the options but not with. I can't figure out where I'm tripping up. I've compared my code with the code supplied by the button generator and it seems to be identical. Any help is appreciated!

 

<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="email goes here">
	<input type="hidden" name="lc" value="AU">
	<input type="hidden" name="item_name" value="Product Title">
	<input type="hidden" name="item_number" value="999">
	<input type="hidden" name="button_subtype" value="products">
	<input type="hidden" name="no_note" value="0">
	<input type="hidden" name="shipping" value="0">
	<input type="hidden" name="add" value="1">
	<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_SM.gif:NonHostedGuest">
	<input type="hidden" name="on1" value="Size">
	<label for="os1">Size</label>
	<select name="os1" required="">
		<option value="" disabled="">Make a selection</option>
        <option value="4&quot; x 11.5&quot;">4" x 11.5" – $1.00</option>
        <option value="8&quot; x 20&quot;">8" x 20" – $10.50</option>
	</select>		
	<input type="hidden" name="currency_code" value="USD">
	<input type="hidden" name="option_select0" value="4&quot; x 11.5&quot;">
	<input type="hidden" name="option_amount0" value="1.00">
	<input type="hidden" name="option_select1" value="8&quot; x 20&quot;">
	<input type="hidden" name="option_amount1" value="10.50">
	<input type="hidden" name="option_index" value="0">
	<input type="hidden" name="on2" value="Message">
	<label for="os2">Message</label>
	<input type="text" name="os2" maxlength="200" class="product-message">
	<div class="paypal-bar">
		<input type="number" name="quantity" value="1" min="1" class="product-qty 77">
		<div class="product-price body-copy">$1</div>
		<input type="submit" name="submit" value="Add To Cart" class="product-submit" alt="Add To Cart">
	</div><!--paypal-bar-->
	<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Login to Me Too
2 REPLIES 2

angelleye
Advisor
Advisor
Does your code actually have the 4&quot; values in it instead of actual quotes, or did that happen when you pasted it here? If that's in your actual code, fix those so they are quotes.
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

MTS_Tiffany
Moderator
Moderator

Hello,

 

Quotes cannot be used in item names for the options. Please remove all the quotes and the options should then work.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.