Login  Register

Re: Enhance configurable (AGGREGATED) products

Posted by Jacopo Cappellato on Nov 28, 2007; 3:01pm
URL: http://ofbiz.116.s1.nabble.com/Enhance-configurable-AGGREGATED-products-tp186096p186099.html

Bilgin,

the original plan was to write services to persist/load a
ProductConfigWrapper object from the db. There is already an entity for
this (never used, so chances are that it will need small cleanups):
ProductConfigConfig

The idea was to have one configId for the configuration and many
ProductConfigConfig records for each one of the option selected.

The problem is that there is no way to link a configurationId to
production run (WorkEffort), order (OrderItem), inventory
(InventoryItem) etc...

An alternative solution (not necessarily a substitute for
ProductConfigConfig, but instead a complementary model): when the order
is created, you create a new Product (of a special type and associated
to the original template, e.g. PC001) and add to it a set of
ProductFeatures (as STANDARD features) each one describing a
configuration option... or just one feature directly associated to a
configuration (thru a new field ProductFeature.configurationId -->
ProductConfigConfig)

Then you can write a service to load a ProductConfigWrapper out of this
new product and then you can call the code to create the production run
whenever you want.

Just my 2 cents

Jacopo


Bilgin Ibryam wrote:

>
> Currently, when an order is created in ofbiz, a production run is generated
> for every AGGREGATED product (through "createProductionRunFromConfiguration"
> service) and the product configuration (kept by ProductConfigWrapper) is
> lost.
>
> So, orders that contains configurable products cannot be edited(canceling,
> updating, appending items)!
> The problem occurs in loadCartFromOrder service called while editing
> existing orders. The configuration cannot be reproduced from order item,
> product cannot be configured properly and cannot be added to cart.
>
> My initial idea was to reproduce configuration from the production run.
> After checking the code, it looks like not possible to me...
> Also in createProductionRunFromConfiguration method  is saw this comment:
> if (config == null && configId != null) {
>        // TODO: load the configuration
>        return ServiceUtil.returnError("Operation not yet implemented");
> }
>
> Probably is needed a new entity to save the configuration before creating
> the production run and loosing ProductConfigWrapper?
> What should contain this new entity? Is there any similar example/pattern in
> ofbiz?
> Do you have any different ideas or suggestions to implement this?
>
> I'd love to get your feedback and implement this in ofbiz.
>
> Thanks,
> Bilgin Ibryam