简体   繁体   中英

Paypal Integration - Add to cart button

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 (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. 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?

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.

paypal offer add to cart button in website with complete coading...Check Link Below.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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