Do you store the type of the item in a cart column? If so then you can do it the same way I suggested but you will use this column that holds the type of item rather than the item id.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.