Jump to content

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


redarrow

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.
Link to comment
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]
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.