Added natural search to product line search
This commit is contained in:
parent
656915b8a8
commit
16efed11ca
@ -13,6 +13,7 @@
|
|||||||
* Copyright (C) 2010 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2010 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -1223,9 +1224,13 @@ class Form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND (p.ref LIKE '%".$filterkey."%' OR p.label LIKE '%".$filterkey."%'";
|
// For natural search
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$filterkey."%'";
|
$scrit = explode(' ', $filterkey);
|
||||||
$sql.=")";
|
foreach ($scrit as $crit) {
|
||||||
|
$sql.=" AND (p.ref LIKE '%".$crit."%' OR p.label LIKE '%".$crit."%'";
|
||||||
|
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$crit."%'";
|
||||||
|
$sql.=")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->barcode->enabled))
|
if (! empty($conf->barcode->enabled))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user