Add properties to CatalogContent (again)

Vote:
 

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?

#321586
May 06, 2024 9:06
Vote:
 

Hi Robert,

I think it is a bug from framework. Content Loader does not return latest published version by default. As I reviewed then you could get correctly only with specific version id.

You can raise a bug to support team to fix it.

#321702
May 08, 2024 8:08
Vote:
 

Hi Binh, 

Thanks for replying. It might be a bug, but due to time constraint we changed the feature we were building - to get the information elsewhere than from the Catalog.

#321938
May 13, 2024 6:50
Vote:
 

Can confirm this is a bug. I will report it to Commerce team, thanks for reporting it and apologies for the trouble it might have caused

#321959
May 13, 2024 11:18
Quan Mai - May 13, 2024 11:22
The bug is COM-18054 (not yet made public)
Vote:
 

Yes, I still see this issue in CMS 12.27.1 and Commerce 14.21

#322007
May 14, 2024 3:42
* 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.