jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Archive for the ‘shopping’ tag

Simple Shopping Cart in CodeIgniter

with 3 comments

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.

Written byadmin

August 21st, 2009 at 8:37 pm

Posted inSnippets Ideas

Tagged with ,