I see how to get the SubCategories in the Category View. But what is the easiest way to display the products PER category on the top level or at least one level up.
Example category page:
Top Level Category
- Sub Category 1
--Show Products of sub category in a @foreach to order the sub category products by sub category.
- Sub Category 2
--Show Products of sub category in a @foreach to order the sub category products by sub category.
Does that make sense?
This is the current Product NopCommerce Category View code for subcategories. It lists the SubCategories BUT it does not list the Products under those SubCategories.
@foreach (var item in Model.SubCategories)
{
<div class="item-box">
<div class="sub-category-item">
<h2 class="title">
<a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title">
@item.Name
</a>
</h2>
<!--WHAT I WANT TO DO-->
<!--I want to list all the products in the sub category here-->
</div>
</div>
}