Shop->Currency; $currencycode = $xml->Shop->CurrencyCode; $paypalemail = $xml->Shop->PaypalEmail; $paypallogo = $xml->Shop->PaypalLogo; $business = $xml->Shop->BusinessName; $url = $xml->Shop->URL; if (!empty($xml->Shop->Fees)){ $fees = $xml->Shop->Fees; } } else { exit(); } $qstr = ''; $paypal_count = 1; foreach($_SESSION['boostershop'] as $id => $item) { $qstr .= '&item_name_' . $paypal_count . '=' . $item['name']; $qstr .= '&amount_' . $paypal_count . '=' . $item['price']; $qstr .= '&quantity_' . $paypal_count . '=' . $item['count']; ++$paypal_count; } // foreach if ($fees != null) { foreach($fees->Fee as $f) { $qstr .= '&item_name_' . $paypal_count . '=' . $f->Name; $qstr .= '&amount_' . $paypal_count . '=' . $f->Cost; $qstr .= '&quantity_' . $paypal_count . '=1'; ++$paypal_count; } } //has fees } // has items $qstr .= '&return='.$url.'&cancel_return='.$url.'/store.html&image_url='.$url.'/'.$paypallogo; print 'https://www.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1&business=' . $paypalemail . $qstr; session_destroy(); } // ajax request ?>