【发布时间】:2014-02-19 21:12:38
【问题描述】:
好的,下面的代码有效。但问题是它不允许用户更改购买的金额。
我正试图弄清楚如何让用户在他们购买门票并进入贝宝页面后,能够更改他们想要拥有的门票数量。
事实上,一旦您登陆贝宝页面,它就会显示您购买的内容,仅此而已。
有什么建议吗?
编辑
如果有人需要我所说的例子,这里有一个:Paying for multiple items (at once) via paypal
查看底部的图像。看到数量栏了吗?我正是这个意思。但是当我尝试他们在那一个中所做的时,它不起作用。我认为这是因为在那一个中,它使用了_cart,我的_donation 呢?
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Specify a Donate button. -->
<input type="hidden" name="cmd" value="_donations">
<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Name Of Business">
<input type="hidden" name="item_number" value="Tickets">
<select name="amount">
<optgroup label="Sponsorship">
<option value="15000" name="platinum">$15,000 - Platinum Sponsorship</option>
<option value="10000">$10,000 - Gold Sponsorship</option>
<option value="5000">$5000 - Silver Sponsorship</option>
<option value="2500">$2,500 - Bronze Sponsorship</option>
</optgroup>
<optgroup label="Individual Seating">
<option value="500">$500 per seat</option>
</optgroup>
<optgroup label="Program Book Tribute Journal Ad">
<option value="600">$600 - Half Page</option>
<option value="1000">$1000 - Full Page</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<br /><br />
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
编辑两个
好吧,有点困惑如何让项目增量显示出来。
建议将不胜感激。
这些是我在上面的帖子中添加的更改:
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
然后添加增量能力......我真的对这些线路以及如何使其适合我的工作感到困惑。
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
所以,对于我的下拉框中的第一项(即白金票),我稍微修改了一下,添加了名称值:
<option value="15000" name="platinum">$15,000 - Platinum Sponsorship</option>
然后,
<input type="hidden" name="item_name_1" value="platinum">
<input type="hidden" name="amount_1" value="15000.00">
但据我所知,这不允许用户将数量更改为他们想要的。
编辑二结束
编辑三个基于 Jared 在下面的代码,但发布了它的完整版本。
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="BLAHBLAH">
<!-- Specify a Donate button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Corporation">
<input type="hidden" name="item_number" value="Ticket Purchase">
<select name="amount">
<optgroup label="Sponsorship">
<option value="Platinum Sponsorship">$15,000 - Platinum Sponsorship</option>
<option value="Gold Sponsorship">$10,000 - Gold Sponsorship</option>
</optgroup>
</select>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Platinum Sponsorship">
<input type="hidden" name="option_amount0" value="15000.00">
<input type="hidden" name="option_select1" value="Gold Sponsorship">
<input type="hidden" name="option_amount1" value="10000.00">
<input type="hidden" name="option_index" value="0">
<br /><br />
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
我从这个表格中得到的只是Your shopping cart is empty.
编辑三结束
编辑四个
1. <input type="hidden" name="item_name" value="Donation">
2. <input type="hidden" name="button_subtype" value="products">
3. <input type="hidden" name="no_note" value="1">
4. <input type="hidden" name="no_shipping" value="2">
5. <input type="hidden" name="currency_code" value="USD">
6. <input type="hidden" name="weight_unit" value="lbs">
7. <input type="hidden" name="add" value="1">
8. <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
我们需要 2、3、4 和 6 吗?
我得到一个,这是一种标记它的方式,对吧?
2、什么是button_subtype?
3,也就是说没有更多的附加信息,对吧?
4,有必要吗?就是在网上买票。
5,显然需要。
6,真的需要 weight_unit 吗?如前所述,这只是一张在线票。
7,是吗?我在猜测增量发生的一种方式?
8,是表示该按钮不是从贝宝托管的,对吗?
您不必回答任何这些问题,您的回答已被接受。只是想知道,仅此而已。
再次感谢你,贾里德。
编辑四结束
【问题讨论】: