November Happy Hour will be moved to Thursday December 5th.

potientiel bug with MetaClasses and catalogsystem or by-design?

Vote:
 

Hi,

I have tried to find documentation regarding meta data plus 2 in regards to EPiServer commerce, but have found practically none, one single page at http://sdk.episerver.com/commerce/1.1.2/default.htm. But that page does suggest that inheritance is possible.

My issue is this, i need a heirarchy of products so i get a BaseProduct that "inherits" from CatalogEntry and other products then derive from BaseProduct. The BaseProduct has around 60 MetaFields and the derived products adds additional metafields.

Example:

 BaseProduct inherits from CatalogNode

 -Field1

 -Field2

 DerivedProductOne inherits from BaseProduct

 -Field3

 DerivedProductTwo inherits from BaseProduct

 -Field4

 -Field5

 

In my world the DerivedProductOne metaclass should now have 3 fields, Field1, Field2 and Field3 and DerivedProductTwo should have 4 fields, Field1, Field2, Field4 and Field5.

 

I have created the MetaClasses like this (simplified) in code:

MetaClass catalogEntry = Mediachase.MetaDataPlus.Configurator.MetaClass.Load(metaDataContext, "CatalogEntry")

MetaClass base = Mediachase.MetaDataPlus.Configurator.MetaClass.Create(metaDataContext, "Mediachase.Commerce.Catalog.User", "ProductBase", "ProductBase friendlyName", "CatalogEntryEx_ProductBase", catalogEntry, false, "ProductBase description");

//adding fields to base class

MetaClass derivedProductOne = Mediachase.MetaDataPlus.Configurator.MetaClass.Create(metaDataContext, "Mediachase.Commerce.Catalog.User", "DerivedProductOne", "DerivedProductOne friendlyName", "ProductBase_DerivedProductOne", base, false, "DerivedProductOne description");

//adding specific fields to derivedProductOne

MetaClass derivedProductTwo = Mediachase.MetaDataPlus.Configurator.MetaClass.Create(metaDataContext, "Mediachase.Commerce.Catalog.User", "DerivedProductTwo", "DerivedProductTwo friendlyName", "ProductBase_DerivedProductTwo", base, false, "DerivedProductTwo description");

//adding specific fields to derivedProductTwo

 
Now I would expect the following:
 
When i go into commerce manager i would expect to be able to create a new product variation based on the DerivedProductOne and DerivedProductTwo, but i cannot, the only thing i see in the metaclass dropdown is ProductBase. Bug?
 
When loading metaclasses through MetaClass.Load(..) for DerivedProductOne and DerivedProductTwo i only see 1 MetaField for DerivedProductOne and 2 MetaFields for DerivedProductTwo where i would exped DerivedProductOne to have 3 MetaFields and DerivedProductTwo to have 4 MetaFields, the Parent for both MetaClasses is ProductBase. Bug?
 
 
 
#64760
Jan 09, 2013 9:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.