[英]Paypal button add to shoping cart
我正在嘗試添加到購物車按鈕。 但是,當我使用該按鈕時,現在會發生以下情況: http : //imgur.com/ldEEOK3
當我單擊按鈕時,我想要按鈕,它將產品添加到購物車,並停留在同一頁面上。
<tr class="record">
<td><?php echo $row['ref']; ?></td>
<td><?php echo $row['nome']; ?></td>
<td><?php echo $row['preco']; ?></td>
<td><form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="paypalID"> //not gonna show it :p
<input type="hidden" name="item_name_1" value="<?php echo $row['nome']; ?>">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="amount_1" value="<?php echo $row['preco']; ?>">
<input type="image" src="https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="PayPal - A forma mais fácil e segura de efetuar pagamentos online!">
<img alt="" border="0" src="https://www.paypalobjects.com/pt_PT/i/scr/pixel.gif" width="1" height="1">
</form>
</tr>
我將發布show cart按鈕的代碼,但是我猜它沒有問題,因為它可以正常工作:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" > <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="encrypted" value="erased the big encrypt code"> <input type="image" src="https://www.paypalobjects.com/pt_PT/i/btn/btn_viewcart_SM.gif" border="0" name="submit" alt="PayPal - A forma mais fácil e segura de efetuar pagamentos online!"> <img alt="" border="0" src="https://www.paypalobjects.com/pt_PT/i/scr/pixel.gif" width="1" height="1"> </form>
您可能需要更改“購物車”按鈕中的某些變量:
<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="paypalID"> //not gonna show it :p
<input type="hidden" name="item_name" value="<?php echo $row['nome']; ?>">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="amount" value="<?php echo $row['preco']; ?>">
<input type="image" src="https://www.paypalobjects.com/pt_PT/PT/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="PayPal - A forma mais fácil e segura de efetuar pagamentos online!">
<img alt="" border="0" src="https://www.paypalobjects.com/pt_PT/i/scr/pixel.gif" width="1" height="1">
</form>
您創建的代碼用於“購物車上傳”功能。 它通常在您的網站中嵌入了某些購物車功能並將購物車的內容傳遞到PayPal進行結帳和付款處理時使用。
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/cart_upload/
請檢查下面的鏈接以獲取“添加到購物車”按鈕的示例代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.