SaaS CMS has officially launched! Learn more now.

Content Loader is not returning Variants for Product


This is my method and I am trying to get all variants by using conent loader. But it doesn't work for me. I am on EpiServer (CMS and Commerce) version 11

private IEnumerable GetChildrenAndRelatedEntries(CatalogContentBase catalogContent)
where TEntryContent : EntryContentBase
var variantContentItems = this.contentLoader.GetChildren(catalogContent.ContentLink).ToList();

var variantContainer = catalogContent as IVariantContainer;
if (variantContainer != null)

return variantContentItems.Where(e => e.IsAvailableInCurrentMarket(this.currentMarket));

Any Idea.

Apr 17, 2018 15:18

You should use the IRelationRepository instead :) See

Apr 17, 2018 15:45

IContentLoader.GetChildren on returns the direct children of the parentLink. I.e. if you have more than 1 level of categories then entries in sub-categories are not returned. Check out, recipe 1.2 

Apr 17, 2018 15:46
* 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.