Im trying to get all ecommerce groups using Razor, and it is working just fine, I get all my groups.
The problem is that I get groups that should not been visible due to assortment rules.
This is how I get my GroupCollection.
groupCollection = new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current().Area.get_Value("AreaEcomShopID")).TopLevelGroups;
By using this I get all top level groups, but I would like to hide those without products due to assortment rules. So I try to add this in my loop.
groupCollection.Where(x => x.HasProducts())
But it does not work. It does not look like it takes assortments into consideration. When I click on the category to see products I dont see them, so the product listing is working fine.