News:

Support the VirtueMart project and become a member

Main Menu

Excludes some categories from search?

Started by virtueb, May 19, 2017, 12:25:02 PM

Previous topic - Next topic

virtueb

Is there possible to exclude some categories from search? Or to setup only categories which should be searched?

hellorain

Hello,

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

Best Regards,
hellorain.
Raincreatives - Virtuemart & Mobile Commerce Experts

jabba

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!
Gianluca Gabella - CEO & Web Developer @ Pixed - www.pixed.it

Studio 42

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.

jabba

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!
Gianluca Gabella - CEO & Web Developer @ Pixed - www.pixed.it

Studio 42

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.

jabba

Thank you for your answer, i can handle php/mysql, just needed to know the file to modify. Thank you!
Gianluca
Gianluca Gabella - CEO & Web Developer @ Pixed - www.pixed.it