News:

Looking for documentation? Take a look on our wiki

Main Menu

Backend product search omits product SKU

Started by dmuntean, January 12, 2012, 04:14:56 AM

Previous topic - Next topic

dmuntean

Hi,

I've just noticed that when you attempt to search for products in the back-end, it does not include results from product_sku. It would be helpful if this could be included. I have most of my products memorized by their sku, not the name. Oh, it would also be neat if after using search product, then editing a product and saving, it would return you to your original search query.

Thanks!

dmuntean

Actually, would you be able to point me to the right file? I'd like to go ahead and add product_sku to the search query. Thanks

pfasshauer


dmuntean

#3
Hi pfasshauer,

Yes, I solved this issue for myself. However, I don't really like hacking core files of virtuemart. It makes upgrading more difficult. But this is what you can do:

Open administrator/components/com_virtuemart/models/product.php

Around Line 94 Replace This:
$this->valid_search_fields= array('product_name');
With This:
$this->valid_search_fields= array('product_name','product_sku');
Around Line 132 Replace This:
$valid_search_fields = array('product_name');
With This:
$valid_search_fields = array('product_name','product_sku');


Is this the best way to do this? Probably not. Does it work? Yes.