VirtueMart Forum

VirtueMart 2 + 3 => Frontend Modules => Topic started by: virtueb on May 19, 2017, 12:25:02 pm

Title: Excludes some categories from search?
Post by: virtueb on May 19, 2017, 12:25:02 pm
Is there possible to exclude some categories from search? Or to setup only categories which should be searched?
Title: Re: Excludes some categories from search?
Post by: hellorain on July 16, 2017, 14:45:55 pm
Hello,

Yes, it can be done. But  From which Search you want to exclude categories?
Any specfic module?

Best Regards,
hellorain.
Title: Re: Excludes some categories from search?
Post by: jabba on June 02, 2018, 13:15:30 pm
Hello, i'm interested in this too but there is no answer yet.

I have the standard virtuemart search module and i need it to look in ALL categories EXCEPT the categories with ids X, Y and Z

Is this possible? How?

Thank you!
Title: Re: Excludes some categories from search?
Post by: Studio 42 on June 02, 2018, 23:04:23 pm
The solution i know :
- add a plugin to override product model to get declared categories to disable from plugin settings
- hack the core product model(bad solution)
- write own search module and result component(or plugin), so you can add parameters in module, in case you need to disable categories only in some cases.
Title: Re: Excludes some categories from search?
Post by: jabba on June 05, 2018, 19:43:36 pm
Thank you for the answers. It's a very small site with no e-commerce (catalog only). Where can i hack the core? As i can see it's the fastest and easy way to achieve this. Then i will re-write the hack every virtuemart update.
Thank you!
Title: Re: Excludes some categories from search?
Post by: Studio 42 on June 06, 2018, 00:19:28 am
YOu have to modify the virtuemart product model  JOOMLA\administrator\components\com_virtuemart\models\product.php
and modify the sortSearchListQuery query to exclude product in categories(but only on searhc in front).
If you dont know mysql+php, it's not so easy to do.
Title: Re: Excludes some categories from search?
Post by: jabba on June 08, 2018, 10:23:31 am
Thank you for your answer, i can handle php/mysql, just needed to know the file to modify. Thank you!
Gianluca