The latest release of Codeigniter 1.7.2 adds a new shopping cart class to the library which permits items to be added to a session that stays active while a user is browsing the site.
Like all Codeigniter libraries, initilization is done as follows:
$this->load->library('cart');
And items are added to the cart as follows:
$data = array(
'id' => 'sku_123ABC',
'qty' => 1,
'price' => 39.95,
'name' => 'T-Shirt',
'options' => array('Size' => 'L', 'Color' => 'Red')
);
$this->cart->insert($data);