带选择下拉菜单的PayPal HTML表单 [英] PayPal HTML form with select drop menu

查看:84
本文介绍了带选择下拉菜单的PayPal HTML表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决这个问题,但是我需要一些帮助.

I am trying to figure this one out, but I need some help.

我想在选择列表中提供多种产品,供客户选择和购买.

I want to offer multiple products in the select list for a customer to choose and buy one.

<FORM action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <INPUT TYPE="hidden" name="cmd" value="_xclick"/>
    <INPUT TYPE="hidden" name="charset" value="utf-8"/>
    <INPUT TYPE="hidden" NAME="return" value="http://www.albertamomentummassage.com/gift-certificate-thank-you/"/>
    <INPUT TYPE="hidden" NAME="rm" value="2"/>
    <INPUT TYPE="hidden" NAME="currency_code" value="CAD"/>
    <INPUT TYPE="hidden" NAME="business" value="daniel_1329709715_biz@gmail.com"/>

    <select name="os_0" value="Therapeutic Massage">
        <option value="2 Hour Masssage">2 Hour Massage $160.00 CAD</option>
        <option value="90 Minute Massage">90 Minute Massage $120.00 CAD</option>
    </select>

    <input type="hidden" name="option_amount0" value="160"/>
    <input type="hidden" name="option_amount1" value="120"/>

    <input type="submit" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" />
</FORM>

一旦我重定向到贝宝,物品说明和物品价格都将丢失.

Once I got redirected to PayPal I am missing, both, item description and item price.

推荐答案

您仍然需要沿着item_name字段发送.下拉列表可作为要添加到购物车中的商品的修饰符.除了下拉列表本身,您还需要在表单中发送option_select(n)和option_amount(n).看看下面的示例,它来自Paypal按钮生成器,应该会让您滚动.

You'll still need to send along an item_name field. The drop down list acts as a modifier for an item to add to the cart. In addition to the drop down list itself, you'll also need to send option_select(n) and option_amount(n) in your form. Check out the example below, it's from the Paypal button generator and should get you rolling.

<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="Yourbiz@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Massage service">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<table>
    <tr><td><input type="hidden" name="on0" value="Duration">Duration</td></tr>
    <tr><td>
    <select name="os0">
    <option value="90 minutes">90 minutes $120.00 CAD</option>
    <option value="2 hours">2 hours $160.00 CAD</option>
    </select>
    </td></tr>
</table>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="option_select0" value="90 minutes">
<input type="hidden" name="option_amount0" value="120.00">
<input type="hidden" name="option_select1" value="2 hours">
<input type="hidden" name="option_amount1" value="160.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_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>

这篇关于带选择下拉菜单的PayPal HTML表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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