Yeah, that looks like what I am looking for. I need to track both quantity and another variable (such as size or color).
Is it storing the cart info in a database or just sessions?
If you are storing stuff in the db, what sort of precausion are you taking to prevent old data from hanging around if the user bails out on the purchase?