Simple Shopping Cart in CodeIgniter
ExpressionEngine Dev Team is preparing a Cart library for CodeIgniter version 1.7.2
If you are interested in a preview of this CodeIgniter shopping cart, you can download the Cart.php from trunk, or you can wait until 1.7.2 is launched.
http://dev.ellislab.com/svn/CodeIgniter/trunk/system/libraries/Cart.php
The documentation is here:
http://dev.ellislab.com/svn/CodeIgniter/trunk/user_guide/libraries/cart.html
Things you can do with this Cart library
Add items to the cart. You use an array specifying id, quantity, price, name and a sub-array with options.
Add multiple items to the cart, at once. Similar to adding a single product but in this case you can specify an array of products.
Display the cart content. For this purpose, you will create a view file and use the Cart functions to retrieve the cart content, options and calculate totals.
Update the cart. For example, updates the quantity for an existing item insider your cart.
More inside this Cart
Then, you can other accessible functions that you can use, for example:
- Calculate the Total amount in the cart.
- Count the number of items in the cart.
- Return an array containing everything inside the cart.
- Return the options assigned for a particular product.
- Destroy the cart.




I’m happy the CodeIgnier Devs is releasing this class, though I would have preferred an Auth/Acl module rather than a shopping cart, which is useful only if you do ecommerce, whereas authentication is a key structure in every of my projects.
Ben
23 Aug 09 at 2:25 am
[...] Simple Shopping Cart in CodeIgniter [...]
Simple Shopping Cart in CodeIgniter | Choose Daily
23 Aug 09 at 8:22 am
[...] New simple Cart Class has been introduced (we commented something about it in an earlier post) [...]
CodeIgniter 1.7.2 released | jigniter™
17 Sep 09 at 11:15 am