News:

Support the VirtueMart project and become a member

Main Menu

Advanced search in Product list - administrative panel

Started by clustermass, February 18, 2012, 01:45:10 AM

Previous topic - Next topic

clustermass

Hello everybody!

I am trying to create some kind of warehouse tracking system using virtuemart 2.0 and joomla 1.7.5.

What I need is to put a list of inventory that we currently have into database. But I also need to have all the serial numbers of every item that we have in stock in order to use serial for search in future. like that:

Item  | Description  | Price  | Quantity
Cisco | 2600 series | 100$ |     5

And here are serials that I need to enter with item as well:

FOC4235245
FOC4232355
FOC4235702
FOC4263343
FOC4235764

So i decided to use custom fields to add serial numbers for each item, like that:



The problem is, that I cannot find them using serial number in the search box. In fact, it is not even a search, it's a filter, and it won't find any items by SKU or description.



My question is, if it is possible to replace this filter named "product search" by real search, that can search items by custom fields, SKU or description?

Thanks in advance.

shinta

I was pretty floored that the backend didn't let you search by sku.  You can hack the backend to search by any field in the products table, but for custom fields you'll have to implement some sort of JOIN clause, since custom fields are stored in a different table.  Anyway, to modify the backend search to allow search by sku and desc you can do this:

Modify administrator/components/com_virtuemart/models/product.php:

Find:
$valid_search_fields = array('product_name');
Change to:
$valid_search_fields = array('product_name', 'product_sku', 'product_s_desc', 'product_desc');

Find:
$this->valid_search_fields = array('product_name');
Change to:
$this->valid_search_fields = array('product_name', 'product_sku', 'product_s_desc', 'product_desc');