Home Notes Web development CodeIgniter E-commerce application

CodeIgniter E-commerce application E-mail
Thursday, 09 April 2009 21:32

Update

I finally incorporated the Pkstore database into my photoblog database, which is a Pixelpost installation.  It was relatively simple.  The steps involved were:

  • Update references to the new database throughout the application
  • Change references to the new field names
  • Copy the tables that store the product sizes available and the product-size relationships to the Pixelpost database

The categories and product-category relationships were easily updated because they are stored in Pixelpost the same way they were stored in the Pkstore database.  So overall it was a pretty quick and painless process.

Now when I add a new picture to my photoblog, it automatically gets added to Pkstore as well.


Update

I've updated the administration dashboard to accomodate viewing only.  Use demo/demo as username/password to view the dashboard.

 


I've launched a beta version of an e-commerce application I've written in PHP using the CodeIgniter framework at Pkstore.


Pkstore

The product on the site is my own photos, from my photoblog.

Some of the features of CodeIgniter I am using, alongside the core, are:

  • Form helper
  • URL helper
  • Image_lib library to generate large thumbnail for product page
  • Session helper

Some functionality I implemented:

  • Prints can be ordered in different sizes.  When a new print is added, the shopping cart checks whether a particular print in a particular size is already in the shopping cart.  If so, the count for the existing entry is updated to include the new entry, otherwise a new entry is created in the shopping cart.
  • Shopping cart can be updated both from the product pages as well as the cart itself.
  • Not all prints are available in all sizes.  The database stores which prints are available in which sizes and presents the appropriate choices in a drop-down menu.
  • Prints can belong to multiple categories.  Again, the database stores which categories a print belongs to and displays it in all appropriate views.

There is also an administrator dashboard, but at the moment I cannot provide guest access to it.  That will be changing soon.

Security measures in use:

  • Encryption of session data
  • Validation of form data to ensure it is the proper variable type and length

I debated whether to generate product thumbnails dynamically or store them on the server.  After some research I discovered it is much more efficient to store them locally, especially since they won't change once they are generated.  Hard drive space is cheap and dynamic generation is computationally expensive, so it's a win-win situation.

The Prototype JavaScript library is used for the image viewer as well as remove and update functions in the shopping cart, which use AJAX.

The design is my own, and, as always, is table-less CSS/XHTML.


Functionality I will be adding:

  • User groups for administration
  • Making dashboard accessible for guests to view (done)
  • Dynamic retrieval of product information from photoblog database (done)