Author Topic: Backend Search by SKU  (Read 5134 times)

prismalight

  • Beginner
  • *
  • Posts: 19
Backend Search by SKU
« on: January 23, 2012, 05:38:08 am »
HI,
I have migrated to VM and everything is working so far.
At the backend I have set SKU as a search able field. If I search in the product tab at the backend I get no results when I enter a SKU phrase. When I enter a Product Name phrase I get results.
Any advise?

prismalight

  • Beginner
  • *
  • Posts: 19
Re: Backend Search by SKU
« Reply #1 on: January 27, 2012, 18:42:19 pm »
I just got it working via a core hack .. better solutions are welcome

replace $this->valid_search_fields             = array('product_name'); by $this->valid_search_fields             = array('product_name','product_sku');
replace $valid_search_fields = array('product_name'); by $valid_search_fields = array('product_name','product_sku');

glasya

  • Beginner
  • *
  • Posts: 48
Re: Backend Search by SKU
« Reply #2 on: February 01, 2012, 12:15:57 pm »
I'm facing the same issue, could you tell me which file you edited these lines in?

prismalight

  • Beginner
  • *
  • Posts: 19
Re: Backend Search by SKU
« Reply #3 on: February 03, 2012, 19:19:40 pm »
replace $this->valid_search_fields  = array('product_name'); by $this->valid_search_fields             = array('product_name','product_sku');
replace $valid_search_fields = array('product_name'); by $valid_search_fields = array('product_name','product_sku');

I just added the red part

petebass4life

  • Beginner
  • *
  • Posts: 1
Re: Backend Search by SKU
« Reply #4 on: July 27, 2012, 08:25:21 am »
as of version 2.0.8e
on line 151 of product.php in administrator/components/com_virtuemart/models
Replace:

$valid_search_fields = array('product_name');

with this:

$valid_search_fields = array('product_name','product_sku');

makevalue

  • Beginner
  • *
  • Posts: 13
Re: Backend Search by SKU
« Reply #5 on: August 02, 2012, 17:47:13 pm »
HI,
I have migrated to VM and everything is working so far.
At the backend I have set SKU as a search able field. If I search in the product tab at the backend I get no results when I enter a SKU phrase. When I enter a Product Name phrase I get results.
Any advise?

When I search in the backend, I am having really poor results finding any specific product.  Is there any documentation on searching?  How do I search for one product to edit?

airone93

  • Beginner
  • *
  • Posts: 19
Re: Backend Search by SKU
« Reply #6 on: August 07, 2012, 21:03:29 pm »
Same issue here.

I'm afraid the backend doesn't include special characters or punctuation in the search.
For sure, a code like "501.001.032" is read as "501001032".

The same happens on frontend search.
The best would be if a module parameter could exclude this character filter.

I may hack my products.php page but the next VM update could erase my changes.

makevalue

  • Beginner
  • *
  • Posts: 13
Re: Backend Search by SKU
« Reply #7 on: August 18, 2012, 22:16:47 pm »
Same issue here.

I'm afraid the backend doesn't include special characters or punctuation in the search.
For sure, a code like "501.001.032" is read as "501001032".

The same happens on frontend search.
The best would be if a module parameter could exclude this character filter.

I may hack my products.php page but the next VM update could erase my changes.

I had my developer hack it too.  I hope that this is addressed in the next update.


airone93

  • Beginner
  • *
  • Posts: 19
Re: Backend Search by SKU
« Reply #8 on: February 03, 2013, 02:00:09 am »
Excuse me, what's the fix for this?
Which file should be modified to address this issue?
Please, if you already fixed that, please, share the solution.
Thanks.