jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Simple Shopping Cart in CodeIgniter

3 comentarios

cart-codeigniterExpressionEngine 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.

Escrito por admin

2009-08-21 at 8:37 pm

Publicado en Snippets Ideas

Tags: ,

3 Responses to 'Simple Shopping Cart in CodeIgniter'

Subscribe to comments with RSS or TrackBack to 'Simple Shopping Cart in CodeIgniter'.

  1. 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

  2. [...] Simple Shopping Cart in CodeIgniter [...]

  3. [...] New simple Cart Class has been introduced (we commented something about it in an earlier post) [...]

Leave a Reply