News:

Support the VirtueMart project and become a member

Main Menu

Search in a Category by keyword

Started by alepoudaki, February 06, 2013, 09:25:57 AM

Previous topic - Next topic

alepoudaki

I want to have a dropdown Menu with all my categories and a textfield to write a keyword in order to search in specific category.

The Virtuemart Product Search module doesn't have this option. How can I do that? Is there an extension for this?

Thanks.

barbaros

Hi,

I couldn't find either, but i've solved the issue by adding little code into the php file.
Before "product search" was bringing the products only if they are under the same category. I have many categories and thousands of products, i wanted to be able to search a product even if they are belong to other categories.  Now it works great.

I'm using also joomla 2.5 and virtuemart 2.

You must change the product.php file under the Administrator/components/com_virtuemart/models

lines 297 and 300 are missing in the original file.


296         if ($virtuemart_category_id > 0) {
297            if (empty($filter_search)) {   
298            $joinCategory = TRUE;
299            $where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
300            }
301         }


Hope it'll help to you.