views:

25

answers:

1

I am currently developing a little ecommerce application to help me get to grips with CodeIgniter and programming in general.

I have a 4 step checkout process.

  1. Customer name, email, shipping country
  2. Shipping option, shipping address
  3. Billing option, billing address
  4. Review and submit

Currently I am storing all this data in the session (cookie for now, db when live) as a JSON encoded array.

I was wondering, am I better off storing the information in the order table linked to cart items so that I can track abandoned carts (contents, step when user exited) or just retaining it in the session and transferring it all when they confirm on the review page.

I am trying to get to grips with some of the options available to me.

+1  A: 

It depends on how you plan to use the data. If you're going to create functionality to mine data on your users' shopping habits, including abandoned carts, then definitely retain that data in a database. If you don't think that is likely to happen then storing it doesn't do you any good and is unnecessary information. But only discard that information if you're sure you're never going to need it. It sounds like you may want to explore abandoned cart reporting at some point in the future so storing the data now, although it won't be mined right away, is probably a good idea.

John Conde