Try our conversational search powered by Generative AI!

Fetch products from catalog

Vote:
 

I have moved a product from one catalog to another and made sure that all the variants of this one product is updated in which category it "belongs to" - but still I can't find it.

For retrieving the products from catalogs i use this - which works fine for the main catalog, but the new alternative catalog continues to be empty.

var catalogEntriesDto = context.GetCatalogEntriesDto(catalog);
if(catalogEntriesDto == null)
                             return new List();
 
var references = context
                             .GetCatalogEntriesDto(catalog)
                             .CatalogEntry
                             .AsEnumerable()
                             .Select(entry => referenceConverter
                                                          .GetContentLink(entry.Code, CatalogContentType.CatalogEntry))
                             .ToList();
 
return references;

Any help would be appreciated. :-)

Thanks

/Kim

#180354
Jul 07, 2017 11:26
Vote:
 

Make sure you updated the catalog on every variant as well.

What is the reason for using the old CatalogEntriesDto instead of the new Content API?

#180355
Jul 07, 2017 13:29
Vote:
 

@Erik 

Found the problem - the problem was that the CatalogContext.Current only can hold the main "Site Catalog" ... So i just be fetching them manually from the ContentRepository as you suggest...

Thanks!

#180356
Jul 07, 2017 13:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.