Saturday 15 May 2010

hybris - What is the advantage of a product variant? -



hybris - What is the advantage of a product variant? -

i confused product variants in hybris.

for example, why take utilize variant size or color?

wouldn't expanding product item include both style , size attributes simplify resulting info model?

any insight appreciated.

variants mutual concept in ecommerce systems. hybris supports others:

http://docs.shopify.com/api/product_variant http://msdn.microsoft.com/en-us/library/ms962267%28v=cs.70%29.aspx http://guides.spreecommerce.com/developer/products.html

so why this? ease of management.

if take wearing apparel example, perhaps have products no size or colour (maybe sunglasses) variations, have products colour variations (hats?) , have products size , colour variations (t-shirts perhaps).

here our setup:

product product bluish product blue/s product reddish product red/m product greenish product green/s product green/xl

in illustration need configure 1 price, on 'product'. need configure 3 images, on 'product blue', 'product red' , 'product green'. can configure stock levels on "leaf" variants.

so different products have different numbers of variations , different ways vary. result don't want fill product table lots of null columns representing these possible variations every product. more extensible approach taken via varianttype metatype.

via approach can create 'concrete' variants (as phone call them) via items.xml, or 'dynamic' variants via run time definition using impex. concrete variants can used in code straight (i.e. using instanceof) cannot added deployment , updatesystem. dynamic variants require more clever coding determine variantattributes on item in general much improve approach , more extensible.

there of course of study argument multi level variant structures bit redundant , false. there no "direction" variants. not naturally navigate product > bluish > small, select bluish little product. argued variant structures should 1 level deep.

hybris

No comments:

Post a Comment