id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	modified_flg
200	商品の AND 検索	nanasess	adachi	"商品の AND 検索を可能にするパッチ

via. http://xoops.ec-cube.net/modules/newbb/viewtopic.php?forum=5&post_id=4922&topic_id=1488

{{{
ndex: LC_Page_Products_List.php
===================================================================
--- LC_Page_Products_List.php
+++ LC_Page_Products_List.php
@@ -438,11 +438,18 @@
 
         // 商品名をwhere文に
         $name = ereg_replace("","", """", $name);
-        if ( strlen($name) > 0 ){
-            $where .= "" AND ( name ILIKE ? OR comment3 ILIKE ?) "";
-            $ret = SC_Utils_Ex::sfManualEscape($name);
-            $arrval[] = ""%$ret%"";
-            $arrval[] = ""%$ret%"";
+        //全角スペースを半角スペースに変換
+        $name = str_replace('　', ' ', $name);
+        //スペースでキーワードを分割
+        $names = preg_split(""/ +/"", $name);
+        //分割したキーワードを一つずつwhere文に追加
+        foreach ($names as $val) {
+            if ( strlen($val) > 0 ){
+                $where .= "" AND ( name ILIKE ? OR comment3 ILIKE ?) "";
+                $ret = SC_Utils_Ex::sfManualEscape($val);
+                $arrval[] = ""%$ret%"";
+                $arrval[] = ""%$ret%"";
+            }
         }
 
         if (empty($arrval)) {


}}}

"	新規開発	closed	低	EC-CUBE2.3.0	フロント	2.0系(正式版)	修正済			
