Hi,
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:
http://world.episerver.com/documentation/Class-library/?documentId=commerce/7.5/A8B3DF01
http://world.episerver.com/documentation/Class-library/?documentId=commerce/7.5/276E6271
Regards.
/Q
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?
Regards
Neil
Hi,
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.
Regards.
/Q
Thanks Q
I think I understand ... the order of events would be:
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:
Hi,
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.
Regards.
/Q
My client has products that have a large number of properties – for example:
Property
Data Type
Adult only
True/False
Dogs allowed
True/False
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?