hi,
i have a shopping cart on my site that i would like to be saved into a data base so i could view the order in a backend application and show it to the customer in a previous orders section.
the code i have so far to add the cart to the session....
<? session_start();
if ( !isset( $_SESSION["cart"] ) ) {
$_SESSION["cart"] = array();
}
$id = $_POST["id"];
$_SESSION["cart"][$id] = $id;
header("location:index.php");
?>
The total is worked out on the cart page...
$sub[]=$info['price'];
}
$subtotal = array_sum($sub);
$postage = 3.50;
$item_total = array_sum($sub);
$final = $item_total + $postage;
echo number_format($final, 2, '.', ',');
}
This all works so how can i save the data?
i have made it so no address is needed as a loginform is shown first. the their address is shown then i need a complete order button to add the cart contents to the database???
many thanks
ben