I'm trying to figure out the best way to get a category by name. I've tried a few things:
I've tried createing an instance of the CategoryRepository, and doing a call _catalogRepository.Get(CategoryName), but that's failing.
I also tried getting the root category node by doing a _categoryRepository.GetRoot(), then looping through the child categories, but the node does not come back with any child entries.
Essentially, I need to do a search of the catalog to retrieve products by category name, vs, category code. The process I'm using is to get a response for a category name, find the category in the catalog, then do the search in the catalog using the code that matches the associated category name.
I'm trying to figure out the best way to get a category by name. I've tried a few things:
I've tried createing an instance of the CategoryRepository, and doing a call _catalogRepository.Get(CategoryName), but that's failing.
I also tried getting the root category node by doing a _categoryRepository.GetRoot(), then looping through the child categories, but the node does not come back with any child entries.
Essentially, I need to do a search of the catalog to retrieve products by category name, vs, category code. The process I'm using is to get a response for a category name, find the category in the catalog, then do the search in the catalog using the code that matches the associated category name.
Thoughts on how best to accomplish this?
Thank you.