I am currently successfully passing multiple variables to my paypal checkout, but cannot pass the Quantity of each item properly. $value represents the quantity chosen by the customer, but when I attempt to pass the info the quantity of the last product is the only one that passes and displays for each item. Seems like there should be a pretty simple solution, any and all help is greatly appreciated!
[php]
$cart_info = array();
foreach($SESSION as $name => $value) {
if ($value>0) {
if (substr($name, 0, 7)=='images’) {
$id = substr($name, 7, (strlen($name)-7));
$get = mysql_query(‘SELECT * FROM images WHERE image_id=’.mysql_real_escape_string((int)$id));
while ($cart_info_row = mysql_fetch_assoc($get)) {
$cart_info[] = array(
‘image_id’ => $cart_info_row[‘image_id’],
‘title’ => $cart_info_row[‘title’],
‘original_cost’ => $cart_info_row[‘original_cost’],
);
[/php]
<form action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://mysite.com/cart_total.php">
[php]$suffix = 1;
echo ‘’;
foreach ($cart_info as $carts){
[/php]
<input type="hidden" name="quantity_<?php echo $suffix; ?>" value="<?php echo $value; ?>">
<input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $carts['title']; ?>">
<input type="hidden" name="amount_<?php echo $suffix; ?>" value="<?php echo $carts['original_cost']; ?>">
[php]}
}
}
}[/php]
[code]
[/code]