Try our conversational search powered by Generative AI!

Flexible property definition on Products


My client has products that have a large number of properties – for example:


Data Type

Adult only


Dogs allowed


Given there are over a 100 of these (and there could be more in the future) – rather define these as individual properties in my class, can this be done in a more dynamic way?


Ideally we want to be able to allow Commerce Managers to enter these facilities repeatedly, giving each one a name, selecting a data type and then providing the value. This way they could add as many as they liked without the need to recompile/redeploy code.


Have you come across anything like this – is it even possible?

Jul 20, 2015 17:24


This is not supported by default in Commerce, but nothing prevent you from doing it by code.

You can use a small tool to read from the product definition file (a CVS, may be), then create a MetaField for each field, then add it to the MetaClass of products. APIs can be found here:



Jul 20, 2015 18:50

Thanks Q,

Any chance you could post some example code?

I undertsand that basically my models are connected to a MetaClass through the inheriting the appropriate type in the EPiServer.Commerce.Catalog.ContentTypes namespace and decorate it with the CatalogContentTypeAttribute attribute.

So what you suggestinng won't affect my model classes directly - how then could I access these created MetaFields if I wanted to display them on a product details page?

Also - we'd have to roll ouur own editor interface as well so that an editor could control through EPiServer?



Jul 21, 2015 13:39


No, After you update the metafield, you just need to restart your site and then the properties will be available in your catalog content. Allthough you will need to access via content.Property["MetafieldName"] instead of strongly typed type, like content.MetafieldName.

The only way to have strongly typed type is to auto-generate the content types, then build.

And no, all properties will be available in Catalog Ui without additional modification.

You might need to contact our support service for sample code.



Jul 21, 2015 14:15

Thanks Q 

I think I understand ... the order of events would be:

  • Use the custom tool to read a file of properties and update the MetaClass first.
  • Then, after restart, when viewing the product in the Catalog UI, all these new fields wouold be rendered as normal.

Thats definately a solution - but could the MetaField be added through the Catalog UI perhaps as some kind of collection MetaField?

So an editor opens a product, and next to an "Options" or Properties field, there's an input box "Add" button where they can add multiple ones at the same time.

Something similar to this:


Jul 21, 2015 17:31


No, the Catalog UI is for editing only, while what you want to do is administration. 

Of course there is nothing prevent you from implementation custom widgets for Catalog UI to do that - but I doubt it will be worth it.



Jul 22, 2015 13:11


Where can I find information custom widgets?


Jul 23, 2015 18:31

Some links I can find: 



Jul 23, 2015 18:36
* 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.