【问题标题】:How to allow the option of increasing the tickets purchased如何允许选择增加购买的门票
【发布时间】: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,是表示该按钮不是从贝宝托管的,对吗?

您不必回答任何这些问题,您的回答已被接受。只是想知道,仅此而已。

再次感谢你,贾里德。

编辑四结束

【问题讨论】:

    标签: html paypal


    【解决方案1】:
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="Your Email Here">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Donation">
    <input type="hidden" name="button_subtype" value="products">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="weight_unit" value="lbs">
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
    <table>
    <tr><td><input type="hidden" name="on0" value="Sponsorship"></td></tr><tr><td><select name="os0">
    <optgroup label="Sponsorship">
        <option value="Platinum Sponsorship">Platinum Sponsorship $15,00.00 USD</option>
        <option value="Gold Sponsorship">Gold Sponsorship $10,000.00 USD</option>
    </optgroup>
    </select> </td></tr>
    </table>
    <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">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>
    

    这是您的按钮的外观,来自贝宝。

    【讨论】:

    • 顺便说一句,您将无法执行 15,000 选项,Paypal 仅允许每笔交易最多 10,000。
    • 天哪!这有效!!!!!!!耶!!!!!谢谢你告诉我最大值是 10,000。没有意识到这一点。将继续传递该信息。虽然只是几个问题,我将其发布在我的帖子中,但除此之外,这个答案完全被接受!再次感谢!!!!
    • 已将我的问题包含在编辑 4 中。是否要回答完全取决于您。
    【解决方案2】:

    捐赠按钮不允许您使用数量,因为它用于捐赠而非购买。但是,您可以拥有添加到购物车按钮的功能,但显示为捐赠按钮。简单地说:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    
    <!-- Specify a Add to Cart button. -->
    <input type="hidden" name="cmd" value="_cart">
    
    <!-- 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 Donation 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>
    

    【讨论】:

    • 这仍然会被视为对企业的捐赠,对吧?
    • 等等,我很困惑。您的代码帖子,它应该按原样工作吗?即,除了_cart,我不需要添加任何其他更改?
    • 对,您可以将值更改为您想要的任何贝宝按钮功能。即:_cart、_donations、_xclick(立即购买)。
    • &lt;input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" 部分是赋予它按钮外观的部分。
    • 我明白了。我的意思是,据我所知……您在上面的代码中所做的唯一更改是 _cart。我的意思是……这会增加用户根据需要增加购买量的能力吗? (顺便说一句,编辑将在帖子中发布。两分钟左右)
    【解决方案3】:
    <input type="hidden" name="Ticket"><select name="os0">
    <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">
    

    【讨论】:

    • 请看我上面帖子的编辑 3。复制了你的代码。收到此错误Your shopping cart is empty.
    猜你喜欢
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多