I want render only specific product, see the example.
CATEGORIES:
> 4 wheels
>>> Cars
> 2 wheels
>>> MotorCycle
>>> Bike
I have Products Simple and Products Grouped in each category.
I want to show only the simple products that belong to the specific category "2 wheels" and show only grouped products that belong to the specific category "4 wheels".
I use this code to check simple /grouped products
@foreach (var product in Model.Products)
{
if (product.ProductType == Nop.Core.Domain.Catalog.ProductType.SimpleProduct)
{
<div class="col-md-2 col-sm-6 col-xs-12">
<div class="item-box">
@Html.Partial("_ProductBox.B2B", product)
</div>
</div>
}
}
But I don't know how to recover first level of category ("2 wheels" or "4 whhels")
In Model.Name I read only second level of category "Cars" or "Bike" ...
In Model.CategoryBreadcrumb.Count I have always the value 0 ...
Where I can read the current top level of the category selected?
thanks