Can anyone suggest how do i get the category name in ProductTemplate.Simple.cshtml? I want to check if a certain category is matched then display messages according to the category name.
ProductDetailsModel containts a list of category names in the Breadcrumb
In the code section at the top you could do
var cateogryList = Model.Breadcrumb.CategoryBreadcrumb.ToList(); foreach(var cateogry in cateogryList) { if (cateogry.Name == "Something") { // do something bool test = true; } }