VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: franayala on September 08, 2014, 12:14:53 PM

Title: [SOLVED] Search including MPN
Post by: franayala on September 08, 2014, 12:14:53 PM
Hi all,

How to include product MPN in search?

This is possible? In configuration back end we can not locate an option to do this. We can include a lot of options to search but no Manufacturer Part Number.

Thanks!!!
Title: Re: Search including MPN
Post by: GJC Web Design on September 09, 2014, 09:37:02 AM
Hopefully will be added in the final VM3 but maybe you can add the field in administrator/components/com_virtuemart/virtuemart.cfg

browse_search_fields=array:`p`.product_sku|category_name|category_description|mf_name|product_name|product_s_desc|product_desc|product_mpn
Title: Re: Search including MPN
Post by: franayala on September 09, 2014, 10:06:35 AM
Not work :(
Title: Re: Search including MPN
Post by: GJC Web Design on September 09, 2014, 10:24:33 AM
ah well - did you look why not?

models/product.php?
Title: Re: Search including MPN
Post by: franayala on September 09, 2014, 15:00:50 PM
I will see. Let me check
Title: Re: Search including MPN
Post by: franayala on September 10, 2014, 12:06:37 PM
it's impossible for me to solve this.

Any help, please?

Thanks!
Title: Re: Search including MPN
Post by: slammy on September 14, 2014, 22:25:11 PM
as far as I can see it´s already included in vm 2.6.10, just tested and it worked ...
Title: Re: Search including MPN
Post by: franayala on September 15, 2014, 00:12:54 AM
not for me. In a clean installation not work :(
Title: Re: Search including MPN
Post by: jjk on September 15, 2014, 11:07:53 AM
Just tested it in my 2.6.10 version. Doesn't work for me.
@slammy
Did you check by chance with Product SKU and MPN being identical? I this case probably your Product SKU was found.
Title: Re: Search including MPN
Post by: slammy on September 15, 2014, 12:30:59 PM
@jjk

this is surprising for me. there are no identicals because I don´t use mpn. I´ve tested it with 12345 and the be-product-search found this one (from > 500 in db) where I´ve edited the mpn with 12345. I can post files if you want, just tell me which ones.
best regards
jens
Title: Re: Search including MPN
Post by: jjk on September 15, 2014, 13:02:25 PM
Quote from: slammy on September 15, 2014, 12:30:59 PM
... I´ve tested it with 12345 and the be-product-search found this one (from > 500 in db) where I´ve edited the mpn with 12345.

Ok, that's the difference. I've tested it with the frontend search. Product SKU is available for the frontend search, MPN is not.
Title: Re: Search including MPN
Post by: slammy on September 15, 2014, 13:19:51 PM
ah - ok you speak about fe-search, sry misunderstood you.
Title: Re: Search including MPN
Post by: franayala on September 15, 2014, 21:02:06 PM
how to include mpn in front send search? :)
Title: Re: Search including MPN
Post by: Milbo on September 19, 2014, 14:55:36 PM
Quote from: GJC Web Design on September 09, 2014, 09:37:02 AM
Hopefully will be added in the final VM3 but maybe you can add the field in administrator/components/com_virtuemart/virtuemart.cfg

browse_search_fields=array:`p`.product_sku|category_name|category_description|mf_name|product_name|product_s_desc|product_desc|product_mpn

Cant work, you add a value for a field, which is not in the array
Title: Re: Search including MPN
Post by: Milbo on September 19, 2014, 14:58:06 PM
try
shopfunctions.php around line 1151, function getValidProductFilterArray

just add 'product_mpn' to the array
Title: Re: Search including MPN
Post by: franayala on September 19, 2014, 18:26:07 PM
Thanks Milbo, but this is for BE, right?

In BE works, but i need to search in FE.

can you support me?

Thanks a lot


Title: Re: Search including MPN
Post by: Milbo on September 20, 2014, 17:50:00 PM
no, should be for the FE, actually
Title: Re: Search including MPN
Post by: franayala on September 21, 2014, 19:07:39 PM
Solved.

product_mpn added to shopfunctions.php and MPN option appears in WM configuration to use as search option.


Thanks a los, Milbo!!