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条)

报告相同问题?

悬赏问题

  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动