Greetings. I've got paypal managing my shopping cart transactions and need to send the user there when they are ready to check-out. I'm sending the variables via $_GET as needed by paypal but I"m needing to generate dynamic variables for each product being sent. I'm probably being way-overdifficult here but here's what I've got now:
$paypal_url="https://www.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1&business=*****EMAIL*****&shipping=0&tax=0";
//build paypal URL - if retailer
foreach($current_cart as $cart_item_array)
$count == '1';
{
//an item in the cart is an array like:
// [0]=>Product ID
// [1]=>Item Price
// [2]=>Qty
$product_id=$cart_item_array[0];
$sql2="SELECT * FROM products WHERE product_id=".$product_id;
$rs2=get_mysql_result($sql2);
$row2=mysql_fetch_array($rs2,MYSQL_ASSOC);
$item_price=$cart_item_array[1];
$qty=$cart_item_array[2];
$paypal_url .= "&item_name_$count=$row2[product_name]&amount_$count=".number_format($item_price,2)."&quantity_$count=$qty";
$count++;
}
I'm sure you get the picture - but the $paypal_url .= is overwriting and I'm trying to figure out how to "store" each one and then use it to build the entire url string at the end.
I need to somehow create a new variable every time around i/e $paypal_url[$count] or something so that each URL string can be pulled together to form one long url.
any help is most appreciated.
thanks
jw