Quantcast
Channel: Customized Commerce 13 and earlier versions
Viewing all articles
Browse latest Browse all 9642

Add properties to CatalogContent (again)

$
0
0

I am trying to add a property to my own CatalogContent.

Previous this topic was created: Add properties to CatalogContent | Optimizely Developer Community And was closed with "Not working".

Then I saw this blog post which says it can be done: https://stefanolsen.com/posts/catalog-roots-can-finally-be-customized-in-optimizely-commerce/ 

-

I can see my new property in the UI, and when the UI is reentered, I can still see the value I set. But I cannot read the value using code. I am trying to load the properties with something like this:

int catalogId = -2147483645;
_contentLoader.Get<MyCatalogContent>(_referenceConverter.GetContentLink(catalogId, CatalogContentType.Catalog, -1))

and 

var catalog = _contentLoader.GetAncestors(product.ContentLink)
	.OfType<MyCatalogContent>()
	.FirstOrDefault();
var x = catalog.MyProperty; // null

I can see the built in values, but not my own.

Any ideas how to read the value for my custom property?


Viewing all articles
Browse latest Browse all 9642

Trending Articles