VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: prismalight on January 23, 2012, 05:38:08 AM

Title: Backend Search by SKU
Post by: prismalight 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?
Title: Re: Backend Search by SKU
Post by: prismalight 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');
Title: Re: Backend Search by SKU
Post by: glasya 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?
Title: Re: Backend Search by SKU
Post by: prismalight 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
Title: Re: Backend Search by SKU
Post by: petebass4life 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');
Title: Re: Backend Search by SKU
Post by: makevalue on August 02, 2012, 17:47:13 PM
Quote from: prismalight 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?

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?
Title: Re: Backend Search by SKU
Post by: airone93 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.
Title: Re: Backend Search by SKU
Post by: makevalue on August 18, 2012, 22:16:47 PM
Quote from: airone93 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.

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

Title: Re: Backend Search by SKU
Post by: airone93 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.