As you make know I am a huge fan of CI and this update has been long over due! The cart class is something that really makes me happy as a developer. I no longer have to look to a shopping cart that only meets half my needs. I can now build and deploy one with ease!
The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard “shopping cart” format, allowing the user to update the quantity or remove items from the cart.
Please note that the Cart Class ONLY provides the core “cart” functionality. It does not provide shipping, credit card authorization, or other processing components.
Load the cart lib and start using!
$this->load->library('cart');
Adding an Item to The Cart
$data = array( 'id' => 'sku_123ABC', 'qty' => 1, 'price' => 39.95, 'name' => 'T-Shirt', 'options' => array('Size' => 'L', 'Color' => 'Red') ); $this->cart->insert($data);
Destroy the cart
$this->cart->destroy();
More info on this can be found in the users guide on the CI website.



Leave A Comment!