$_POST['name'], 'price' => $_POST['price'], 'count' => 1 ); } } /// remove item if (isset($_POST['remove'])) { $rid = substr($_POST['remove'],2); if ($_SESSION['boostershop'][$rid]['count'] >1) { $_SESSION['boostershop'][$rid]['count'] -= 1; } else { unset($_SESSION['boostershop'][$rid]); } } if (!empty($_SESSION['boostershop'])) { $currency = ''; $currencycode = ''; $paypalemail = ''; $business = ''; $fees = array(); /************************* GET XML CONFIG *************************/ if (file_exists('config.xml')) { $xml = simplexml_load_file('config.xml'); $currency = $xml->Shop->Currency; $currencycode = $xml->Shop->CurrencyCode; $paypalemail = $xml->Shop->PaypalEmail; $business = $xml->Shop->BusinessName; if (!empty($xml->Shop->Fees)){ $fees = $xml->Shop->Fees; } } else { exit(); } $out .= ''; $sum = 0; foreach($_SESSION['boostershop'] as $id => $item) { $price = $item['price'] * $item['count']; $sum += $price; $out .= ' '; } if ($fees != null) { foreach($fees->Fee as $f) { $sum += $f->Cost; $out .= ''; } } //has fees $out .= ''; $out .= '
'.$item['count'].' '.$item['name'].' '.number_format($price,2).'
'.$f->Name.' '.number_format($f->Cost,2).'
Summary '.$currencycode.' '.number_format($sum,2).'
'; print $out; } // else { print 'Your cart is empty'; } } // ajax request ?>