我正在尝试设置一个简单的单页“立即购买”表单,其中包含多个产品列表和一个文本输入框,允许用户指定他们对每个产品的需求量或指定“0”不添加产品到购物车。当然,如果有人的数量只有0,PayPal会返回“您输入的数量值无效。数量值必须是大于或等于1的整数。”是否有一个简单的解决办法让PayPal忽略提交数量为“0”的产品?我的表单基本上看起来像这样(像total_item_ *这样的字段用于jquery计算脚本):
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="frmCreateCheckboxRange">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="youremail@mail.com">
<input type="hidden" name="currency_code" value="US">
<fieldset>
<table width="500">
<!-- Product 1 -->
<tr>
<td align="center">
<input type="text" name="quantity_1" id="qty_item_1" value="0" size="2" />
<input type="hidden" name="item_name_1" value="Non-Driver Event Pit Passes (6/ 29 - 7/ 2)" />
<input type="hidden" name="amount_1" value="30.00" />
</td>
<td>Non-Driver Event Pit Passes (6/ 29 - 7/ 2)</a></td>
<td align="center" id="price_item_1">$30.00</td>
<td align="center" id="total_item_1">$0.00</td>
</tr>
<!-- Product 2 -->
<tr>
<td align="center">
<input type="text" name="quantity_2" id="qty_item_2" value="0" size="2" />
<input type="hidden" name="item_name_2" value="Non-Driver Single Day Pit Passes (Fri. 6/29)" />
<input type="hidden" name="amount_2" value="15.00" />
</td>
<td>Non-Driver Single Day Pit Passes (Fri. 6/29)</td>
<td align="center" id="price_item_2">$15.00</td>
<td align="center" id="total_item_2">$0.00</td>
</tr>
</table>
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit">
</fieldset>
</form>
答案 0 :(得分:1)
您最好的选择是为每件商品添加Remove from Cart
按钮。