PHP Paypal在购物车中显示Paypal中的多个项目

时间:2016-03-08 01:35:44

标签: php paypal

我想在购物车中显示Paypal中的多个项目。但它只显示购物车中的最后一项。当我将输入类型更改为输入时,它会在checkout.php中以文本框形式显示购物车中的项目但是当我单击paypal按钮时它只显示最后一项

    <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="business" value="grabget@shop.com">
    <input type="hidden" name="cmd" value="_cart">  
    <input type="hidden" name="upload" value="1">  

     <?php

        global $con;
            $ip = getIp();
            $sel_price = "select * from cart where ip_add='$ip'";
            $run_price = mysqli_query($con, $sel_price);
            while ($p_price=mysqli_fetch_array($run_price)){
                    $pro_id = $p_price['p_id'];
                    $product_qty = $p_price['qty'];
                    $pro_price = "select * from products where product_id='$pro_id'";
                    $srscart_dtl = mysqli_query($con, $pro_price);  
        $srowcart_dtl = mysqli_num_rows($srscart_dtl);
        if($srowcart_dtl > 0)
        {
           $cnt=1;
           while($srscart_dtl1 = mysqli_fetch_assoc($srscart_dtl))
           {
      ?>    
                 <input type="hidden" name="item_name_<?php echo $cnt ?>"   value="<?php echo $srscart_dtl1['product_title']; ?>"/>
                   <input type="hidden" name="amount_<?php echo $cnt ?>" value="<?php echo  $srscart_dtl1['product_price']; ?>"/>

      <?php
                    $cnt++;
                }
            }
        }
      ?>

      <input type="hidden" name="currency_code" value="PHP">


      <!-- Display the payment button. -->
      <input type="image" name="submit" border="0"
      src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"
      alt="PayPal - The safer, easier way to pay online">
      <img alt="" border="0" width="1" height="1"
      src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >

    </form>

0 个答案:

没有答案