dqm88684 2012-05-09 11:57
浏览 144
已采纳

Paypal集成 - 添加到购物车按钮

I'm making an ecommerce site and I'm currently trying to implement my cart using Paypal.

I have a table of products created via the following code:

<?php
    while($row=mysql_fetch_array($result)) {
    ?>
    <tr>
    <td><?php echo $row['name'] ?></td>
    <td><?php echo $row['description'] ?></td>
    <td>£<?php echo $row['price'] ?></td>
    <td><?php echo $row['stockLevel'] ?></td>
    <td><!--Add to cart button will go here--></td>
    </tr>

    <?php
    }
    ?>

This is going through my table and getting the component details and showing them through a table. Now with Paypal add to cart buttons you have to enter the details of a product manually (e.g. Enter the products name, price etc) and then Paypal generates it for you on its site so you can just copy/paste the HTML. I was wondering if there was a way of doing what I am doing now whereby I am populating the table via the database, but also creating a Paypal button which links to that component at the same time so I wouldn't have to create a seperate button for each component?

  • 写回答

2条回答 默认 最新

  • douxiu6835 2012-05-09 22:09
    关注

    For those wondering how I did it:

    You simply do <?php echo $row['name'] ?> where 'name' is your particular column. All I was missing was an echo.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!