Author Topic: Backend product search omits product SKU  (Read 2358 times)

dmuntean

  • Beginner
  • *
  • Posts: 35
Backend product search omits product SKU
« on: January 12, 2012, 04:14:56 am »
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

  • Beginner
  • *
  • Posts: 35
Re: Backend product search omits product SKU
« Reply #1 on: January 12, 2012, 04:18:03 am »
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

  • Beginner
  • *
  • Posts: 7
Re: Backend product search omits product SKU
« Reply #2 on: January 24, 2012, 04:35:46 am »
Did you ever solve this issue?

dmuntean

  • Beginner
  • *
  • Posts: 35
Re: Backend product search omits product SKU
« Reply #3 on: January 24, 2012, 16:48:22 pm »
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:
Code: [Select]
$this->valid_search_fields= array('product_name');With This:
Code: [Select]
$this->valid_search_fields= array('product_name','product_sku');Around Line 132 Replace This:
Code: [Select]
$valid_search_fields = array('product_name');With This:
Code: [Select]
$valid_search_fields = array('product_name','product_sku');

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