id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	modified_flg
464	受注新規追加機能での同一商品追加時の処理	Yammy	Yammy	"受注新規追加機能で、同一商品追加時の処理ですが、現状同じ商品が既にあっても、もう一行追加されます。
既に同じ商品がある場合は、行を追加せずに数量を＋１するように処理を変更しました。


{{{
Index: LC_Page_Admin_Order_Edit.php
===================================================================
--- LC_Page_Admin_Order_Edit.php        (リビジョン 18013)
+++ LC_Page_Admin_Order_Edit.php        (作業コピー)
@@ -702,7 +702,25 @@
     function lfInsertProduct($product_id, $classcategory_id1, $classcategory_id2) {
         $arrProduct = $this->lfGetProductsClass($product_id, $classcategory_id1, $classcategory_id2);
         $this->arrForm = $this->objFormParam->getFormParamList();
-        $this->lfSetProductData($arrProduct);
+        $existes = false;
+        $existes_key = NULL;
+        if (!empty($this->arrForm['product_id']['value'])) {
+            foreach ($this->arrForm['product_id']['value'] AS $key=>$val) {
+                if ($val == $product_id && $this->arrForm['product_id']['classcategory_id1'][$key] == $classcategory_id1 && $this->arrForm['product_id']['classcategory_id2'][$key] == $classcategory_id2) {
+                    // 既に同じ賞品がある場合
+                    $existes = true;
+                    $existes_key = $key;
+                }
+            }
+        }
+
+        if ($existes) {
+            // 既に同じ賞品がある場合
+            ++$this->arrForm['quantity']['value'][$existes_key];
+        } else {
+            // 既に同じ賞品がない場合
+            $this->lfSetProductData($arrProduct);
+        }
     }

     function lfUpdateProduct($product_id, $classcategory_id1, $classcategory_id2, $no) {
}}}
"	改善提案	closed	低	EC-CUBE2.4.1	管理画面	2.4.0RC-2	修正済			
