PayPal: Choosing multiple items with quantities

吃可爱长大的小学妹 提交于 2019-12-25 02:55:12

问题


I have made a PayPal form where I wish to sell multiple items and quantities (see screenshot). However when I use the code similar to the one written below I get a error if some of the items haven't been selected (quantity=0). The error says "A quantity value must be an integer greater than or equal to one." But I can't figure out how I could make the form behave like I want if I can't have some items with the quantity of 0.

Does anyone have a solution that fits my needs? I wouldn't like to have a "add to cart" button on every item.

Thanks!

<form>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="myemail">
<input type="hidden" name="upload" value="">

<input type="hidden" name="item_name_1" value="First item">
<input type="hidden" name="amount_1" value="9">
<select name="quantity_1"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select>

<!-- more items -->

<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

screenshot http://kejk.se/skar.png


回答1:


You would need to code in the logic not to send over items that have no quantities. The cart upload would only want to send over an item that has a quantity of atleast 1.



来源:https://stackoverflow.com/questions/15931241/paypal-choosing-multiple-items-with-quantities

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!