Hey Guys所以我试图使用Paypal对网站的某个部分进行编码,直到我需要添加该选项,如果客户希望购买额外的商品以及他们想要的颜色。我可以选择Paypal所选择的颜色但是我似乎无法在账单上加上12.00英镑的额外价格,我可以选择提前发货,工作正常,不知道我哪里出错了?
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<!-- Replace "business" value with your PayPal Email Address or your Merchant Account ID -->
<input type="hidden" name="business" value="email@mybiz.com">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="item_name" value="Personal Built Board">
<input type="hidden" name="amount" value="45.00">
<!-- Replace value with the web page you want the customer to return to after a successful transaction -->
<input type="hidden" name="return" value="http://www.yourwebsite.com/ThankYou.html">
<!-- Replace value with the web page you want the customer to return to after item cancellation -->
<input type="hidden" name="cancel_return" value="http://www.yourwebsite.com/Cancel.html">
<!-- Note: shipping override variable is used with this example -->
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHosted">
<div class="build1">Select Board:  
<input type="hidden" name="on1" value="Board">
<select name="os1">
<option value="BLACK" selected>BLACK</option>
<option value="LIGHT BLUE">LIGHT BLUE</option>
<option value="DARK BLUE">DARK BLUE</option>
<option value="PINK">PINK</option>
<option value="GREEN">GREEN</option>
<option value="RED">RED</option>
<option value="PURPLE">PURPLE</option>
<option value="ORANGE">ORANGE</option>
<option value="YELLOW">YELLOW</option>
<option value="WHITE">WHITE</option>
</select>
</div>
<div class="build2">Front Wheels:  
<input type="hidden" name="on2" value="Wheels">
<select name="os2">
<option value="BLUE" selected>BLUE</option>
<option value="BLACK">BLACK</option>
<option value="PINK">PINK</option>
<option value="GREEN">GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="WHITE">WHITE</option>
<option value="ORANGE">ORANGE</option>
<option value="RED">RED</option>
<option value="PURPLE">PURPLE</option>
<option value="PURPLE TRANS">PURPLE TRANS</option>
<option value="CLEAR BLACK">CLEAR BLACK</option>
<option value="CLEAR WHITE">CLEAR WHITE</option>
</select></div>
<div class="build4">Select Truck:  
<input type="hidden" name="on3" value="Truck">
<select name="os3">
<option value="ALUMINUM" selected>ALUMINUM</option>
<option value="BLACK">BLACK</option>
<option value="WHITE">WHITE</option>
</select></div>
<div class="build3">Back Wheels:  
<input type="hidden" name="on2" value="Wheels">
<select name="os2">
<option value="BLUE" selected>BLUE</option>
<option value="BLACK">BLACK</option>
<option value="PINK">PINK</option>
<option value="GREEN">GREEN</option>
<option value="YELLOW">YELLOW</option>
<option value="WHITE">WHITE</option>
<option value="ORANGE">ORANGE</option>
<option value="RED">RED</option>
<option value="PURPLE">PURPLE</option>
<option value="PURPLE TRANS">PURPLE TRANS</option>
<option value="CLEAR BLACK">CLEAR BLACK</option>
<option value="CLEAR WHITE">CLEAR WHITE</option>
</select></div>
<div class="build5">
<p> </p>
<p>Extra Wheels?  
<input type="hidden" name="on4" value="Extra Wheels">
<select name="os4">
<option value="BLUE" selected>BLUE</option>
<option value="MORE COLOURS TO BE ADDED">MORE</option>
</select>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="BLUE">
<input type="hidden" name="option_amount0" value="12.00">
<input type="hidden" name="option_index" value="0">
</p>
</div>
<div class="build5">
<p> </p>
<p>Next Day Delivery?  
<select name="shipping" style="margin-bottom: 5px;">
<option selected value="0.00">NO</option>
<option value="4.99">YES</option>
</select>
<br>
</p>
</div>
<div class="get-download">
<p> </p>
<p>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_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"></p>
</form>
答案 0 :(得分:1)
我不是100%,但我认为PayPal只允许一个包含价格的选择表格,这必须是os0。
因此,您需要移动任何价格为os0的选项,然后这将与option_amount0和option_select0相关。
<input type="hidden" name="on0" value="Extra Wheels">
<select name="os0">
<option value="BLUE" selected>BLUE</option>
<option value="MORE COLOURS TO BE ADDED">MORE</option>
</select>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="BLUE">
<input type="hidden" name="option_amount0" value="12.00">
<input type="hidden" name="option_index" value="0">