Hi Charles
Good question!
At the moment we have little to zero documentation. Let me try and help you out with some pointers here.
1. The CatalogNavigation object is used to work out the current request from the url of the page. So this allows you to see what category, product, search terms etc are supplied.
2. The variable cats holds all the categories within the system.
3. If we have a category in CatalogNavigation we could use some LINQ to work out if its got a parent category and what that parent category would be.
var currentCat = allCats.Where(c => c.CategoryID == catNav.CategoryID).FirstOrDefault();
if(currentCat != null && currentCat.ParentCategoryID > 0){
var parentCategory = allCats.Where(c => c.CategoryID == currentCat.ParentCategoryID).FirstOrDefault();
}
That should then get you the parent category of the current category the customer has requested to view.
You could just write an extension method in Visual Studio and then reference that namespace in the Razor script if you want to get intellisence while coding up the method.
Another tip is to use Just Decompile or similar to have a look at our objects and methods. The main DLL would be CartViper.Modules.Store.dll and the namespace would be the Catalog one which contains the objects and controllers for the product and category data.
I hope this gives you a help. I know its a bit overwhelming without documentation but that is something we can try to improve.
Regards
Mark