Jump to content

Shopping with PayPal


timmah1

Recommended Posts

I really hope someone can help me here, this is the only thing holding up this project I'm working on.

 

I have a script that uses Authorize.net and PayPal to buy items. To buy multiple items though, I have to use

PayPal's shopping cart style script.

 

The problem I'm having is, every item that is listed has the same values.

How would I go about making sure every Add To Cart has different values?

 

I can echo out the values and they are correct, but when I implement the form part, they're all the same.

Here is what I have

<table width="100%" border="0" cellspacing="0" cellpadding="0">
      
        <?php
		$package;
		$package["name"] = $_SESSION['SESS_NAME'];
		$package["price"] = $_SESSION['SESS_PRICE'];
		$package["date"] = $_SESSION['SESS_DATE'];
		$package["sport"] = $_SESSION['SESS_SPORT'];

		foreach( $package as $key => $value){

     ?><tr>
        <td><?=$value;?></td>
        <td><input type="hidden" name="cmd" value="_cart" />
          <input type="hidden" name="add" value="1" />
          <input type="hidden" name="bn" value="webassist.dreamweaver.4_5_0" />
          <input type="hidden" name="business" value="[email protected]" />
          <input type="hidden" name="item_name" value="<?=$value;?>" />
          <input type="hidden" name="item_number" value="<?=$_SESSION['SESS_DATE'];?>" />
          <input type="hidden" name="amount" value="<?=$_SESSION['SESS_PRICE'];?>" />
          <input type="hidden" name="currency_code" value="USD" />
          <input type="hidden" name="return" value="http://vegasdsports.com/core/success.php" />
          <input type="hidden" name="cancel_return" value="http://vegasdsports.com/core/cancel.php" />
          <input type="hidden" name="receiver_email" value="[email protected]" />
          <input type="hidden" name="mrb" value="R-3WH47588B4505740X" />
          <input type="hidden" name="os0" value="<?=$_SESSION['SESS_SPORT'];?>" />
          <input type="hidden" name="pal" value="ANNSXSLJLYR2A" />
          <input type="hidden" name="no_shipping" value="1" />
          <input type="hidden" name="no_note" value="1" />
          <input type="image" name="submit" src="http://images.paypal.com/images/x-click-but10.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!" /></td>
     
      </tr>
       <?php } ?><br />
    </table>

 

Can anybody please help me out?

 

Thank you in advance

 

Link to comment
https://forums.phpfreaks.com/topic/137601-shopping-with-paypal/
Share on other sites

Not sure but your whole implementation seems wrong.

 

<?php
         $package;
         $package["name"] = $_SESSION['SESS_NAME'];
         $package["price"] = $_SESSION['SESS_PRICE'];
         $package["date"] = $_SESSION['SESS_DATE'];
         $package["sport"] = $_SESSION['SESS_SPORT'];

         foreach( $package as $key => $value){

 

Your session variables can each only hold one string, so whatever you last defined it as is what it is.  You can't add to them like arrays (at least i don't think you can).

 

So it's no wonder that when you print out all your items, they all come up with the same values.

Link to comment
https://forums.phpfreaks.com/topic/137601-shopping-with-paypal/#findComment-719310
Share on other sites

The sessions are set fine, when I echo the sessions, they come out exactly like they are suppose too

The problem is when it comes to the form, it echo's out the same values for everything

 

Right now though, unfortunately, that's the least of my worries according to the person I'm doing the site for,

I have to figure this out here first

http://www.phpfreaks.com/forums/index.php/topic,230672.0.html

Link to comment
https://forums.phpfreaks.com/topic/137601-shopping-with-paypal/#findComment-719313
Share on other sites

Archived

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

×
×
  • 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.