简体   繁体   English

贝宝集成-添加到购物车按钮

[英]Paypal Integration - Add to cart button

I'm making an ecommerce site and I'm currently trying to implement my cart using Paypal. 我正在建立一个电子商务网站,目前正在尝试使用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 (eg Enter the products name, price etc) and then Paypal generates it for you on its site so you can just copy/paste the HTML. 现在,使用Paypal添加到购物车按钮,您必须手动输入产品的详细信息(例如,输入产品名称,价格等),然后Paypal在其网站上为您生成它,以便您可以复制/粘贴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? 我想知道是否有一种方法可以通过数据库填充表,还可以创建同时链接到该组件的Paypal按钮,因此我不必创建单独的数据库每个组件的按钮?

For those wondering how I did it: 对于那些想知道我是如何做到的:

You simply do <?php echo $row['name'] ?> where 'name' is your particular column. 您只需执行<?php echo $row['name'] ?> ,其中'name'是您的特定列。 All I was missing was an echo. 我所缺少的只是回声。

paypal offer add to cart button in website with complete coading...Check Link Below. Paypal报价已添加到网站上具有完整编码的购物车按钮...检查下面的链接。

https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/web-accept-to-sc-button-outside https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/web-accept-to-sc-button-outside

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

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