Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

I would like to see a shopping cart with paypal example please

Recommended Posts

Hi there hope everyones ok and can help.

At the moment i need to see a shopping cart and also the way you have inplemented the pay pal code please cheers.

As you know, i no how to program a shooping cart but need to know the best way so any examples would be grate as i dont wont to spend wasting hours getting it wrong.

This is also sometihnk i want to study so plase help cheers.

as simple as ever cheers.

Share this post


Link to post
Share on other sites
There's all sorts of information relevant to this available from the Merchant Tools section of www.paypal.com - information, guides, sample code, etc. is all there.

Share this post


Link to post
Share on other sites
Andy, I have been on that sight for 4 months once and we all agreed that the site of paypal was confusing so if you got a example of your own would be more usefull as i trust the user on here as the codes on paypal are all confussing or wrong cheers mate.

Creating the shoppping cart is a more thing i need to know like the database format.


as you can see i understand the paypal theory know its the cart i need to know cheers.
[code]
<?
$sql = "SELECT * FROM PRODUCTS where ID=" . $ID;
$result = @mysql_query($sql);
while ($row=mysql_fetch_array($result))
{
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="xyzzy@xyzzy.com">
<input type="hidden" name="item_name" value='<?php echo($row['description']) ?>'>
<input type="hidden" name="item_number" value='<?php echo($row['id']) ?>'>
<?
$Cost = $row['price'];
$SandH = $row['weight'] * $ship_factor;
$Price = $Cost + $SandH;
?>
<input type="hidden" name="amount" value='<?php echo($Price) ?>'>
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<?
}
?>
[/code]

Share this post


Link to post
Share on other sites
I think I understand - maybe not.  You want to build your own cart but use PayPal's checkout, i.e. use the data from your shopping cart table to construct a single PayPal 'pay now' form for the complete order and the final total, rather than your users being whizzed off to PayPal's cart for every item they add an item to the cart.

If that's what you want, the database structure is not much more than id, item descr, price, session_id and you select items with the same session number to display the cart contents to the user.

Share this post


Link to post
Share on other sites
http://simpleshop.org/ - that's what I used as the basis for the cart I wrote (and still use)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.