kapilt / getpaid

Automatically exported from code.google.com/p/getpaid
0 stars 0 forks source link

make ILineItemFactory a multiadapter of IShoppingCart and IPayable, and perhaps IBrowserRequest #169

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It feels like ILineItemFactory would do well being a multiadapter of 
IShoppingCart and IPayable, 
and perhaps IBrowserRequest. 

The context for this is so that one can create different line items, annotate 
the base one, or mark 
with new interfaces when a line item is created based on the buyable context 
and perhaps the 
request (for theme or form based custom behaviour)

Examples of wanting to complement the current line item implementation:

- add session/buyer specific data such as subscription details or promotion 
codes

- persist dynamic content that is not part of the persisted buyable content 
object but which was 
generated at the time the buyer accessed the item and which is relevant to the 
item being 
purchased (the results of a collection object perhaps?)

While this is probably a simple change in the factory interface and 
registration for 
ILineItemFactory, I gather there are implications down the line in the order 
admin part of this 
system.

Original issue reported on code.google.com by matt.hal...@gmail.com on 17 Jan 2008 at 8:32

GoogleCodeExporter commented 8 years ago
Agree! It seems as though the current LineItem is only good for static 
products. As
soon as options are presented to a buyable item (eg. different 
color/size/etc.), the
LineItem should be more flexible.

Original comment by juerg.sc...@gmail.com on 28 Jan 2008 at 1:10

GoogleCodeExporter commented 8 years ago
re juerg, you can use separate subclasses of line item. shipping support uses a
custom line item for example.

re matt, i'm changing the lineitemfactory to a multi adapter for shopping cart, 
and
payable. still debating request, should be in the trunk shortly.

also nothing keeps you from creating an aribtrary line item and stuffing it 
directly
into the cart, as long as it conforms to the base lineitem interface.

Original comment by kapilt@gmail.com on 21 Feb 2008 at 6:38