Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi again
After a lot of testing i got this to work.
Here is the code...
IContentLoader contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
var referenceConverter = ServiceLocator.Current.GetInstance<ReferenceConverter>();
var myCatalog = contentLoader.GetChildren<CatalogContent>(referenceConverter.GetRootLink()).FirstOrDefault(x => x.ContentLink.Equals(CurrentPage.ProductCategoryReferense));
ICatalogSystem catalog = ServiceLocator.Current.GetInstance<ICatalogSystem>();
var nodes = catalog.GetCatalogNodes(myCatalog.CatalogId);
I hope this help anyone...
Hi
I have a CMS page with a property, the property looks like this:
[CultureSpecific]
[UIHint(EPiServer.Commerce.UIHint.CatalogContent)]
[Display(Name = "Product catalog",
Description = "Product category parent referense",
GroupName = SystemTabNames.Content)]
public virtual ContentReference ProductCatalogReferense { get; set; }
And I want to get all the sub categories in that catalog.
I have try:
var categoryList = catalog.GetCatalogNode(CurrentPage.ProductCategoryReferense.ID);
But its getting null
The thing is I dont know how to use "UIHint.CatalogContent"
Does someone have any idea?