简体   繁体   English

使用php一次性向paypal cart提交多个项目

[英]submitting multiple items to paypal cart at once with php

I have some items for sale that have 2 and 3 levels of customization. 我有一些待售的物品有2级和3级的定制。 Once set the user adds them to my onsite cart. 设置完成后,用户将它们添加到我的现场购物车中。 Problem is, how can i send each item to paypal on checkout? 问题是,如何在结账时将每件物品发送到贝宝? The only code ive found for dynamic buttons supports only a single item. 我发现动态按钮的唯一代码仅支持单个项目。

<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="EMAIL">
<input type="hidden" name="item_name" value="Item #1">
<input type="hidden" name="item_number" value="123456">
<input type="hidden" name="amount" value="7.00">
<input type="hidden" name="shipping" value="0">
<input type="hidden" name="shipping2" value="0">
<input type="hidden" name="handling" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
<input type="hidden" name="undefined_quantity" value="1">
<input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

I tried adding 我尝试添加

<input type="hidden" name="item_name_2" value="Item #1">
<input type="hidden" name="item_number_2" value="123456">
<input type="hidden" name="amount_2" value="7.00">

But no positive result. 但没有积极的结果。

Any ideas? 有任何想法吗?

Here is the solution 这是解决方案

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="email@email.com">
<input type="hidden" name="item_name_1" value="Item #1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item #2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form> 

为什么不发送客户必须支付给PayPal的总金额?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM