July 2, 2014 admin

How to restrict virtuemart product search to specific categories – Virtuemart 2.0.6 for Joomla 2.5

Hi guys,
I have seen alot of people using Virtuemart shopping cart for their online shop. Everyone wants his/her own type of modules and plugins for shop.

I have seen people failing to restrict search for specific categories for joomla 2.5. So there is an easy hack for you that will help you to restrict search to specific categories.

Open this file:
/administrator/components/com_virtuemart/models/product.php

On line 416:
$whereString = ‘ WHERE (‘.implode(‘ AND ‘, $where ).’) ‘;

replace this code with
$whereString = ‘ WHERE (‘.implode(‘ AND ‘, $where ).’) AND ( `#__virtuemart_product_categories`.`virtuemart_category_id` IN(1,2,3) )’;

here 1,2,3 are ids of your categories from where u want to do search.

Tagged: ,

Leave a Reply

Your email address will not be published. Required fields are marked *