Showing results for 
Search instead for 
Did you mean: 

Add to Cart Button with Options Help

Posted on

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="" 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>
	<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">
	<img alt="" border="0" src="" width="1" height="1">

Add to Cart Button with Options Help

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 -
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!

Add to Cart Button with Options Help




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

Haven't Found your Answer?

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