I use CMS(7.18) and Commerce(8.3.0).
If I change property value programatically, value saved to Commerce Manager, but not changed in Commerce Catalog.
If I change value using UI, all works fine.
var catalogRow = catalogManager.GetCatalog();
var metaDataContextClone = CatalogContext.MetaDataContext.Clone();
metaDataContextClone.UseCurrentThreadCulture = false;
foreach (var catalogLanguageRow in catalogRow.GetCatalogLanguageRows())
metaDataContextClone.Language = catalogLanguageRow.LanguageCode;
var metaObject = MetaObject.Load(metaDataContextClone, catalogEntryDto.CatalogEntry.CatalogEntryId, catalogEntryMetaClass);
What I doing wrong?
The problem with MetaObject is that it does not raise the event required for the front-end site to know there is an update. You will need to raise it manually. That's why we suggest to use new APIs (via IContentRepository) instead.
If I use IContentRepository, it works very slow (in comparison with MetaObject).
Could you please give example, how to raise event?
The reason MetaObject is faster is because it does not involve versions (via IContentRepository), which is, unfortunately, slow. So if you raise event, it'll be equally slow.
The good news is we are working to make the IContentRepository has same performance as MetaObject, which is possibly released in upcoming major release (Commerce 9).