That would be one of the perfect fits for a @SessionState object. @SessionState(create=true) private ShoppingCart shoppingCart; ...
You can put all logic needed into this class (like addItem(Item it, int count) and just display it with a ShoppingCartView component. For example with a simple Parameter you could discern if it is the small view , which is mostly in the top right corner of the page which only tells you the number of items and the sum of their prices or the full blown view needed in the checkout process or in an overview where the customer can change the number of items to buy or delete them from the basket etc.You would only need different blocks for each type in the template and delegate to them depending on the parameter. public class ShoppingCartView { @Parameter(required=true, value="small" defaultPrefix="literal") private String type; } 2009/8/21 Eldred Mullany <eldred.mull...@easypay.co.za> > Hi There > > > > At some stage in the very near future I need to develop a Shopping Cart > Component that will be session based. The challenge in writing this > would be is to have the cart component updated on the fly when I add > items to the basket (no database must be session based). I have a vague > idea of using an Event Listener that needs to fire a method to update > the component (zone update maybe?) on any page on the website. > > > > I have had a look at Jumpstart sharing data across multiple pages which > is a very simple example. I need some more in depth info or even some > code snippet just to get an idea or if anyone has developed an open > source shopping cart component in T5 that I could look at. > > > > I am not looking for easy way out copy and paste, just info pls and a > few code snippets if someone has done this. > > > > Many thanks > > Eldred Mullany > > > >