Look at it this way:
The information you want to maintain and carry from page to page, script to script, and all the way through checkout is: the customer, items he/she has ordered, and how many of each item. Tracking the customer is done by the session module itself via the SID (Session ID), so all you have to do for that is use 'session_start()" for each page. An item and how many of it should be added to "$SESSION['cart']" when the user clicks to order that item. So you could structure "$SESSION['cart']" like:
[CODE]$_SESSION['cart'][$item_number] => $item_quantity[/CODE]Meaning, when the user clicks to order an item, that item number is used as the index for the second array dimension, and its quantity as the value associated with that index. This is the information you need to persistently store in "_$SESSION", the information your "add_item()" method should add to "$_SESSION". The other stuff, such as item price, total price, item description, etc. can be either computed or retrieved from db "as-needed".
When the customer get to checkout, his "$_SESSION" may look like this:
[CODE]$_SESSION['cart'] => array([1066] => 2
[0201] => 5
[0205] => 1)[/CODE](i.e., "Customer's cart contains 2 of item #1066, 5 of item #0201, and 1 of item #0205).
Then you can compute total cost, shipping weight, etc., and add customer shipping information, allocate order number, get payment, etc. Any of these that need to be carried through checkout page to page would be given their own indexes;
[CODE]$_SESSION['customer_name'] => 'Junior Johnson'
$SESSION['order_number'] => '12345'
$SESSION['total_order_price'] => ((2 $00.98) +
(5 $08.98) +
(1 * $98.98))
$_SESSION['payment method'] => 'Visa'
etc.[/CODE]hth