Advanced search just showing the main categories ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello we are now working setting up a new nopCommerce store

The challenge is that we do have a lot of products 30 000 + active every day in the webstore
This a means that we use main categories and quite a bit of subcategories in the setup.

Is there any solution /module that allow having the advanced search, only to show the main categories in the Categroy dropdown, but search all of that category?

We are currently using 10 main categories (Books,Comics,Manga, etc etc etc,)  
But we are also using 150 subcategories inside those.

That creates a very long dropdown list
6 years ago
I don't know of any plugins that enhance the built-in advanced search functionality.

For a few years we implemented Google Custom Search Engine service on our site and it was pretty slick because it showed results from our blog pages, forum pages, topic pages, product tag pages as well...and we could weight the results so that product pages were always listed before informational pages. They have discontinued that service, but there are semi-affordable options available like AddSearch.com. Search Google for "google custom search engine alternatives"

Currently, I use the nop Instant Search plugin from nop-templates.com. It allows you to enable a category drop down filter to the main search box in the header. It only shows the main categories, and as the customer types, it populates with results that include photos. The CSS can be modified too.
6 years ago
Hello and thanks for the reply

We are actually building it on the pavilion theme from Nop-Templates,
That template already have Nop Instant Search installed, so it will active search by top level category on the frontpage. What is your experience using Instant search?

I just wanted to know if there was any way possible, to show only top level categories on the standard Nop solution search page
(when it already have the option to Automatically search sub categories yes/no option)
6 years ago
Hi,

I answered to you in our forum but I will post the reply here for the other members.

"It is possible if you are using the Source version of nopCommerce because you will have to modify the nopCommerce source code.

1. Find the PrepareSearchModel method in the CatalogModelFactory (For nopCommerce 3.9. if you are using some other version this method won't be there).

2. The top level categories have parentCategoryId = 0.
Replace "var allCategories = _categoryService.GetAllCategories(storeId: _storeContext.CurrentStore.Id);"
with "var allCategories = _categoryService.GetAllCategories(storeId: _storeContext.CurrentStore.Id).Where(c => c.ParentCategoryId == 0).ToList();"

Please note that this is a sample code and it is not tested. If you are not using nopCommerce 3.9 it is possible that the methods, properties, names, etc. to be different.
Also, you will have to check "Automatically search sub categories" by default otherwise the search results won't be correct."

Regards,
Stoyan
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.