贝宝:选择包含数量的多个项目 [英] PayPal: Choosing multiple items with quantities

查看:81
本文介绍了贝宝:选择包含数量的多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了一个PayPal表单,我希望出售多件商品和数量(请参见截图)。但是,当我使用类似于下面所写的代码时,如果某些项目未被选中(数量= 0),则会出现错误。错误显示数量值必须是大于或等于1的整数。但我无法弄清楚,如果我无法获得数量为0的某些项目,我如何才能使表单的行为符合我的要求。

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.

谢谢!

<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>

截图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.

这篇关于贝宝:选择包含数量的多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆