Try our conversational search powered by Generative AI!

Get Category by name

Vote:
 

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.

#229752
Oct 22, 2020 19:49
Vote:
 

Unfortunately there is no easy way to do that. If you are using Find, or any other indexed search you might want to try it out. 

#229790
Oct 23, 2020 9:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.