バージョン選択

フォーラム

メニュー

オンライン状況

53 人のユーザが現在オンラインです。 (43 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 53
もっと...

サイト内検索

バグ報告 > 管理機能 > v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い

管理機能

新規スレッドを追加する

スレッド表示 | 古いものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
sumida
投稿日時: 2014/1/19 10:11
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
これが、最後です。
edit.tpl

diff -ur orig/edit.tpl new/edit.tpl
--- orig/edit.tpl	2014-01-08 21:34:26.000000000 +0900
+++ new/edit.tpl	2014-01-17 22:50:50.000000000 +0900
@@ -94,11 +94,13 @@
         }
     });
 
-    function quantityCopyForSingleShipping(product_index){
+// changed #2428,#2485
+    function quantityCopyForSingleShipping(shipping_index, product_index, shipment_product_index){
         var product_index = parseInt(product_index);
         var input_quantity = $('input[name^="quantity[' + product_index + ']"]').val();
-        $('input[name^="shipment_quantity[0][' + product_index + ']"]').val(input_quantity);
+        $('input[name^="shipment_quantity[' + shipping_index + '][' + shipment_product_index + ']"]').val(input_quantity);
     }
+// changed #2428,#2485
 
 //-->
 </script>
@@ -115,6 +117,9 @@
     <input type="hidden" id="edit_product_class_id" name="edit_product_class_id" value="" />
     <input type="hidden" id="no" name="no" value="" />
     <input type="hidden" id="delete_no" name="delete_no" value="" />
+<!--{* added *}-->
+    <input type="hidden" id="product_select_product_type_id" name="product_select_product_type_id" value="" />
+<!--{* added *}-->
     <!--{foreach key=key item=item from=$arrSearchHidden}-->
         <!--{if is_array($item)}-->
             <!--{foreach item=c_item from=$item}-->
@@ -326,7 +331,17 @@
             受注商品情報
             <a class="btn-normal" href="java script:;" name="recalculate" onclick="eccube.setModeAndSubmit('recalculate','anchor_key','order_products');">計算結果の確認</a>
             <!--{if $arrForm.shipping_quantity.value <= 1}-->
+<!--{* changed *}-->
+<!--{if $arrForm.quantity.value == 0}--><!--{* 受注情報の新規登録 *}-->
             <a class="btn-normal" href="java script:;" name="add_product" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?order_id=<!--{$arrForm.order_id.value|h}-->&shipping_id=<!--{$top_shipping_id}-->', 'search', '615', '500', {menubar:'no'}); return false;">商品の追加</a>
+<!--{else}-->
+    <!--{if $arrForm.product_type_id.value[0] == $smarty.const.PRODUCT_TYPE_DOWNLOAD}--><!--{* 受注情報の編集:ダウンロード商品 *}-->
+            <a class="btn-normal" href="java script:;" name="add_product" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?order_id=<!--{$arrForm.order_id.value|h}-->&product_select_product_type_id=<!--{$smarty.const.PRODUCT_TYPE_DOWNLOAD}-->', 'search', '615', '500', {menubar:'no'}); return false;">商品の追加</a>
+    <!--{else}--><!--{* 受注情報の編集:通常商品 *}-->
+            <a class="btn-normal" href="java script:;" name="add_product" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?order_id=<!--{$arrForm.order_id.value|h}-->&shipping_id=<!--{$top_shipping_id}-->&product_select_product_type_id=<!--{$smarty.const.PRODUCT_TYPE_NORMAL}-->', 'search', '615', '500', {menubar:'no'}); return false;">商品の追加</a>
+    <!--{/if}-->
+<!--{/if}-->
+<!--{* changed *}-->
             <!--{/if}-->
         </h2>
 
@@ -345,6 +360,13 @@
             </tr>
             <!--{section name=cnt loop=$arrForm.quantity.value}-->
             <!--{assign var=product_index value="`$smarty.section.cnt.index`"}-->
+<!--{* added #2428,#2485 *}-->
+            <!--{if $arrForm.shipping_quantity.value > 1}-->
+                <!--{assign var=shipping_product_index value="`$smarty.section.cnt.index`"}-->
+            <!--{else}-->
+                <!--{assign var=shipping_product_index value="`$arrOrderIndex[$smarty.section.cnt.index]`"}-->
+            <!--{/if}-->
+<!--{* added #2428,#2485 *}-->
             <tr>
                 <td class="center">
                     <!--{$arrForm.product_code.value[$product_index]|h}-->
@@ -357,9 +379,21 @@
                     <input type="hidden" name="classcategory_name2[<!--{$product_index}-->]" value="<!--{$arrForm.classcategory_name2.value[$product_index]|h}-->" id="classcategory_name2_<!--{$product_index}-->" />
                     <br />
                     <!--{if $arrForm.shipping_quantity.value <= 1}-->
-                        <a class="btn-normal" href="java script:;" name="change" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?no=<!--{$product_index}-->&order_id=<!--{$arrForm.order_id.value|h}-->&shipping_id=<!--{$top_shipping_id}-->', 'search', '615', '500', {menubar:'no'}); return false;">変更</a>
+<!--{* changed #2428,#2485 *}-->
+<!--{if $arrForm.product_type_id.value[$product_index] == $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
+                        <a class="btn-normal" href="java script:;" name="change" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?no=<!--{$product_index}-->&order_id=<!--{$arrForm.order_id.value|h}-->&product_select_product_type_id=<!--{$smarty.const.PRODUCT_TYPE_DOWNLOAD}-->', 'search', '615', '500', {menubar:'no'}); return false;">変更</a>
+<!--{else}-->
+                        <a class="btn-normal" href="java script:;" name="change" onclick="eccube.openWindow('<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/product_select.php?no=<!--{$shipping_product_index}-->&order_id=<!--{$arrForm.order_id.value|h}-->&shipping_id=<!--{$top_shipping_id}-->&product_select_product_type_id=<!--{$smarty.const.PRODUCT_TYPE_NORMAL}-->', 'search', '615', '500', {menubar:'no'}); return false;">変更</a>
+<!--{/if}-->
+<!--{* changed #2428,#2485 *}-->
                         <!--{if count($arrForm.quantity.value) > 1}-->
-                            <a class="btn-normal" href="java script:;" name="delete" onclick="eccube.setValue('delete_no', <!--{$product_index}-->, 'form1'); eccube.setValue('select_shipping_id', '<!--{$top_shipping_id}-->', 'form1'); eccube.setModeAndSubmit('delete_product','anchor_key','order_products'); return false;">削除</a>
+<!--{* changed #2428,#2485 *}-->
+<!--{if $arrForm.product_type_id.value[$product_index] == $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
+                            <a class="btn-normal" href="java script:;" name="delete" onclick="eccube.setValue('delete_no', <!--{$product_index}-->, 'form1'); eccube.setValue('product_select_product_type_id', <!--{$smarty.const.PRODUCT_TYPE_DOWNLOAD}-->, 'form1'); eccube.setModeAndSubmit('delete_product','anchor_key','order_products'); return false;">削除</a>
+<!--{else}-->
+                            <a class="btn-normal" href="java script:;" name="delete" onclick="eccube.setValue('delete_no', <!--{$shipping_product_index}-->, 'form1'); eccube.setValue('product_select_product_type_id', <!--{$smarty.const.PRODUCT_TYPE_NORMAL}-->, 'form1'); eccube.setValue('select_shipping_id', '<!--{$top_shipping_id}-->', 'form1'); eccube.setModeAndSubmit('delete_product','anchor_key','order_products'); return false;">削除</a>
+<!--{/if}-->
+<!--{* changed #2428,#2485 *}-->
                         <!--{/if}-->
                     <!--{/if}-->
                 <input type="hidden" name="product_type_id[<!--{$product_index}-->]" value="<!--{$arrForm.product_type_id.value[$product_index]|h}-->" id="product_type_id_<!--{$product_index}-->" />
@@ -375,7 +409,15 @@
                 <td class="center">
                     <!--{assign var=key value="quantity"}-->
                     <span class="attention"><!--{$arrErr[$key][$product_index]}--></span>
-                    <input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->"  onChange="quantityCopyForSingleShipping('<!--{$product_index}-->')" />
+<!--{* changed #2428,#2485 *}-->
+<!--{* changed *}-->
+<!--{if $arrForm.product_type_id.value[$product_index] == $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->" />
+<!--{else}-->
+                    <input type="text" name="<!--{$key}-->[<!--{$product_index}-->]" value="<!--{$arrForm[$key].value[$product_index]|h}-->" size="3" class="box3" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key][$product_index]|sfGetErrorColor}-->" id="<!--{$key}-->_<!--{$product_index}-->"  onChange="quantityCopyForSingleShipping('<!--{$top_shipping_id}-->', '<!--{$product_index}-->', '<!--{$shipping_product_index}-->')" />
+<!--{/if}-->
+<!--{* changed *}-->
+<!--{* changed #2428,#2485 *}-->
                 </td>
                 <!--{assign var=price value=`$arrForm.price.value[$product_index]`}-->
                 <!--{assign var=quantity value=`$arrForm.quantity.value[$product_index]`}-->
@@ -470,6 +512,9 @@
         </table>
         <!--{assign var=key value="shipping_quantity"}-->
         <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|h}-->" />
+<!--{* added *}-->
+<!--{if $arrForm.quantity.value == 0 || $arrForm.product_type_id.value[0] != $smarty.const.PRODUCT_TYPE_DOWNLOAD}--><!--{* 受注情報の新規登録 *}--><!--{* 受注情報の編集:ダウンロード商品以外 *}-->
+<!--{* added *}-->
         <!--▼お届け先情報ここから-->
         <a name="shipping"></a>
         <h2>お届け先情報
@@ -747,6 +792,9 @@
             </tr>
         </table>
         <!--▲受注商品情報ここまで-->
+<!--{* added *}-->
+<!--{/if}-->
+<!--{* added *}-->
 
         <div class="btn-area">
             <ul>
sumida
投稿日時: 2014/1/19 10:10
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
LC_Page_Admin_Order_ProductSelect.php

diff -ur orig/LC_Page_Admin_Order_ProductSelect.php new/LC_Page_Admin_Order_ProductSelect.php
--- orig/LC_Page_Admin_Order_ProductSelect.php	2013-08-26 23:43:24.000000000 +0900
+++ new/LC_Page_Admin_Order_ProductSelect.php	2014-01-17 22:19:54.000000000 +0900
@@ -76,6 +76,9 @@
 
         $this->tpl_no = $this->getNo(array($_GET,$_POST));
         $this->shipping_id = $this->getShippingId(array($_GET,$_POST));
+// added
+        $this->product_select_product_type_id = $this->getProductTypeId(array($_GET,$_POST));
+// added
 
         switch ($this->getMode()) {
             case 'search':
@@ -212,6 +215,12 @@
         $arrForm = $objFormParam->getHashArray();
         $where = 'alldtl.del_flg = 0';
         $bind = array();
+// added
+        if (isset($this->product_select_product_type_id)) {
+                    $where .=    ' AND alldtl.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_type_id = ? AND del_flg = 0 GROUP BY product_id)';
+                    $bind[] = $this->product_select_product_type_id;
+        }
+// added
         foreach ($arrForm as $key => $val) {
             if ($val == '') {
                 continue;
@@ -274,6 +283,22 @@
 
         return null;
     }
+// added
+    /**
+     * リクエストパラメーターsearch_product_type_idを取ってくる。
+     * @param unknown_type $globalParams
+     */
+    public function getProductTypeId($globalParams)
+    {
+        foreach ($globalParams as $params) {
+            if (isset($params['product_select_product_type_id']) && $params['product_select_product_type_id']!= '') {
+                return intval($params['product_select_product_type_id']);
+            }
+        }
+
+        return null;
+    }
+// added
 
     /**
      * 取得している並び順で並び替え
@@ -306,5 +331,8 @@
         $objFormParam->addParam('商品コード', 'search_product_code', LTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK', 'SPTAB_CHECK'));
         $objFormParam->addParam('フッター', 'footer', LTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK', 'SPTAB_CHECK'));
         $objFormParam->addParam('届け先ID', 'shipping_id', LTEXT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+// added
+        $objFormParam->addParam('商品種別', 'product_select_product_type_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+// added
     }
 }


disp.tpl

diff -ur orig/disp.tpl new/disp.tpl
--- orig/disp.tpl	2014-01-17 22:33:48.000000000 +0900
+++ new/disp.tpl	2014-01-17 22:34:24.000000000 +0900
@@ -204,9 +204,14 @@
             </tr>
         <!--{/if}-->
     </table>
+<!--{* added *}-->
+    <!--{if $arrForm.product_type_id.value[0] != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
+<!--{* added *}-->
     <!--▼お届け先情報ここから-->
     <h2>お届け先情報</h2>
+<!--{* deleted
     <!--{if $arrForm.product_type_id.value[0] != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
+deleted *}-->
     <!--{foreach name=shipping from=$arrAllShipping item=arrShipping key=shipping_index}-->
         <!--{if $arrForm.shipping_quantity.value > 1}-->
             <h3>お届け先<!--{$smarty.foreach.shipping.iteration}--></h3>


product_select.tpl

diff -ur orig/product_select.tpl new/product_select.tpl
--- orig/product_select.tpl	2013-09-19 11:49:03.000000000 +0900
+++ new/product_select.tpl	2014-01-17 22:20:36.000000000 +0900
@@ -78,6 +78,18 @@
 
         fm.mode.value = 'select_product_detail';
         fm.anchor_key.value = 'order_products';
+// added
+        if (!class1_id) {
+            // 規格が存在しない商品の場合
+            fm.product_select_product_type_id.value = eccube.productsClassCategories[product_id]['__unselected2']['#0']['product_type'];
+        } else if (class1_id && (class1_id != '__unselected') && class2_id && (class2_id != 'undefined')) {
+            // 規格1&規格2の商品の場合
+            fm.product_select_product_type_id.value = eccube.productsClassCategories[product_id][class1_id]['#' + class2_id]['product_type'];
+        } else if (class1_id && (class1_id != '__unselected') && (typeof eccube.productsClassCategories[product_id][class1_id]['#0'] != 'undefined')) {
+            // 規格1のみの商品の場合
+            fm.product_select_product_type_id.value = eccube.productsClassCategories[product_id][class1_id]['#0']['product_type'];
+        }
+// added
         fm.submit();
         window.close();
 
@@ -143,6 +155,9 @@
     <input name="search_pageno" type="hidden" value="" />
     <input name="shipping_id" type="hidden" value="<!--{$shipping_id}-->" />
     <input name="no" type="hidden" value="<!--{$tpl_no|h}-->" />
+<!--{* added *}-->
+    <input name="product_select_product_type_id" type="hidden" value="<!--{$product_select_product_type_id|h}-->" />
+<!--{* added *}-->
     <table class="form">
         <col width="20%" />
         <col width="80%" />
sumida
投稿日時: 2014/1/19 10:08
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
参考までに、分割で修正案を。
なお、#xxxxは、各チケット対応に修正したコードです。

LC_Page_Admin_Order_Edit.php

diff -ur orig/LC_Page_Admin_Order_Edit.php new/LC_Page_Admin_Order_Edit.php
--- orig/LC_Page_Admin_Order_Edit.php	2014-01-09 20:45:36.000000000 +0900
+++ new/LC_Page_Admin_Order_Edit.php	2014-01-17 23:04:11.000000000 +0900
@@ -277,6 +277,10 @@
             case 'multiple':
                 $objFormParam->setParam($_POST);
                 $objFormParam->convParam();
+// added #2403
+                //複数配送時に各商品の総量を設定
+                $this->setProductsQuantity($objFormParam);
+// added #2403
                 $this->arrErr = $this->lfCheckError($objFormParam);
                 break;
 
@@ -292,6 +296,10 @@
             case 'append_shipping':
                 $objFormParam->setParam($_POST);
                 $objFormParam->convParam();
+// added #2403
+                //複数配送時に各商品の総量を設定
+                $this->setProductsQuantity($objFormParam);
+// added #2403
                 $this->addShipping($objFormParam);
                 break;
 
@@ -301,6 +309,28 @@
 
         $this->arrForm        = $objFormParam->getFormParamList();
         $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys));
+// added #2428,#2485
+        $arrOrderIndex = array();
+        // お届け先が1口の場合
+        if ($objFormParam->getValue('shipping_quantity') == 1) {
+            // 受注情報の商品
+            $arrProductClassId = $objFormParam->getValue('product_class_id');
+            foreach($arrProductClassId as $order_index =>  $orderItem) {
+                // お届け先
+                $arrShipmentProductClassId = $objFormParam->getValue('shipment_product_class_id');
+                foreach($arrShipmentProductClassId as $shipment) {
+                    // お届け先の商品
+                    foreach($shipment as $shipment_index => $shipmentItem) {
+                        // 同じ商品
+                        if ($orderItem == $shipmentItem) {
+                            $arrOrderIndex[$order_index] = $shipment_index;
+                        }
+                    }
+                }
+            }        
+        }
+        $this->arrOrderIndex = $arrOrderIndex;
+// added #2428,#2485
         $this->top_shipping_id      = array_shift((array_keys($this->arrAllShipping)));
         $this->arrDelivTime   = SC_Helper_Delivery_Ex::getDelivTime($objFormParam->getValue('deliv_id'));
         $this->tpl_onload .= $this->getAnchorKey($objFormParam);
@@ -432,6 +462,9 @@
         $objFormParam->addParam('修正商品規格ID', 'edit_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
         $objFormParam->addParam('対象届け先ID', 'select_shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
         $objFormParam->addParam('アンカーキー', 'anchor_key', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+// added
+        $objFormParam->addParam('商品選択用商品種別', 'product_select_product_type_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+// added
     }
 
     /**
@@ -852,6 +885,14 @@
      */
     public function doDeleteProduct($delete_no, &$objFormParam)
     {
+// added
+$product_select_product_type_id = $objFormParam->getValue('product_select_product_type_id');
+if ($product_select_product_type_id == PRODUCT_TYPE_DOWNLOAD) {
+        $arrPreProductClassIds         = $objFormParam->getValue('product_class_id');
+        $delete_product_class_id       = $arrPreProductClassIds[$delete_no];
+        $is_product_delete = true;
+} else {
+// added
         $select_shipping_id    = $objFormParam->getValue('select_shipping_id');
 
         //変更前のproduct_class_idが他の届け先にも存在するか
@@ -872,6 +913,9 @@
                 }
             }
         }
+// added
+}
+// added
 
         //商品情報から削除
         if ($is_product_delete) {
@@ -938,6 +982,29 @@
      */
     public function shipmentAddProduct(&$objFormParam, $add_product_class_id)
     {
+// added
+$product_select_product_type_id = $objFormParam->getValue('product_select_product_type_id');
+if ($product_select_product_type_id == PRODUCT_TYPE_DOWNLOAD) {
+            //受注商品情報に追加
+            $objProduct = new SC_Product_Ex();
+            $arrAddProductInfo = $objProduct->getDetailAndProductsClass($add_product_class_id);
+            $arrPreProductClassIds = $objFormParam->getValue('product_class_id');
+            $arrProducts = $this->checkInsertOrderProducts($objFormParam, $arrPreProductClassIds, $add_product_class_id, $arrAddProductInfo);
+            if (isset($arrProducts)) {
+                $objFormParam->setParam($arrProducts);
+            } else {
+                /* ダウンロード商品(既存の商品を追加)の場合、受注情報にcheckInsertOrderProductsで数量の追加がない。 */
+                foreach($arrPreProductClassIds as $key => $value) {
+                    if ($value == $add_product_class_id) {
+                        $arrQuantity = $objFormParam->getValue('quantity');
+                        $arrQuantity[$key]++;
+                        $objFormParam->setValue('quantity', $arrQuantity);
+                        break;
+                    }
+                }
+            }
+} else {
+// added
         //複数配送に商品情報追加
         $select_shipping_id = $objFormParam->getValue('select_shipping_id');
 
@@ -968,6 +1035,9 @@
             $objFormParam->setParam($arrProducts);
         }
         $objFormParam->setParam($arrShipmentProducts);
+// added
+}
+// added
     }
 
     /**
@@ -981,6 +1051,27 @@
     public function shipmentEditProduct(&$objFormParam, $edit_product_class_id, $change_no)
     {
         $arrPreProductClassIds = $objFormParam->getValue('product_class_id');
+// added
+$product_select_product_type_id = $objFormParam->getValue('product_select_product_type_id');
+if ($product_select_product_type_id == PRODUCT_TYPE_DOWNLOAD) {
+        $pre_product_class_id = $arrPreProductClassIds[$change_no];
+        $is_product_delete = true;
+        if ($pre_product_class_id == $edit_product_class_id) {
+            $is_product_delete = false;
+        } else {
+            $objProduct = new SC_Product_Ex();
+            $arrAddProductInfo = $objProduct->getDetailAndProductsClass($edit_product_class_id);
+            //受注商品情報に追加
+            $arrProducts = $this->checkInsertOrderProducts($objFormParam, $arrPreProductClassIds, $edit_product_class_id, $arrAddProductInfo);
+            $objFormParam->setParam($arrProducts);
+        }
+
+        //商品情報から削除
+        if ($is_product_delete) {
+            $this->checkDeleteProducts($objFormParam, $arrPreProductClassIds, $pre_product_class_id, $this->arrProductKeys);
+        }
+} else {
+// added
         $select_shipping_id    = $objFormParam->getValue('select_shipping_id');
 
         $arrShipmentProducts = $this->getShipmentProducts($objFormParam);
@@ -988,7 +1079,9 @@
         //既にあるデータは1つだけ数量を1増やす
         $pre_shipment_product_class_id = $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id][$change_no];
         if ($pre_shipment_product_class_id == $edit_product_class_id) {
+/* deleted #2486
             $arrShipmentProducts['shipment_quantity'][$select_shipping_id][$change_no] ++;
+deleted #2486 */
         } elseif (in_array($edit_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])) {
             //配送先データ削除
             $arrShipmentProducts = $this->deleteShipment($objFormParam, $this->arrShipmentItemKeys , $select_shipping_id, $change_no);
@@ -1025,6 +1118,9 @@
         if ($is_product_delete) {
             $this->checkDeleteProducts($objFormParam, $arrPreProductClassIds, $pre_shipment_product_class_id, $this->arrProductKeys);
         }
+// added
+}
+// added
     }
 
     /**
@@ -1091,9 +1187,17 @@
             }
 
             $arrProductsClass = $objFormParam->getValue('product_class_id');
-            $arrProductsQuantity = $objFormParam->getValue('quantity');
+// changed #2451
+            $arrQuantity['quantity'] = $objFormParam->getValue('quantity');
+// changed #2451
             foreach ($arrProductsClass as $relation_key => $product_class_id) {
+// added #2451
+if ($arrUpdateQuantity[$product_class_id]) {
+// added #2451
                 $arrQuantity['quantity'][$relation_key] = $arrUpdateQuantity[$product_class_id];
+// added #2451
+}
+// added #2451
             }
             $objFormParam->setParam($arrQuantity);
         }
@@ -1164,6 +1268,10 @@
     public function checkInsertOrderProducts(&$objFormParam, $arrProductClassIds, $insert_product_class_id, $arrAddProductInfo)
     {
         if(!$arrProductClassIds || !in_array($insert_product_class_id, $arrProductClassIds)){
+// added #2430
+            $objTaxRule = new SC_Helper_TaxRule_Ex();
+            $arrTax = $objTaxRule->getTaxRule(0, $insert_product_class_id, 0, 0);
+// added #2430
             $arrAddProducts = array();
 
             $arrAddProductInfo['product_name'] = ($arrAddProductInfo['product_name'])?
@@ -1171,10 +1279,14 @@
             $arrAddProductInfo['price']        = ($arrAddProductInfo['price'])?
                                                  $arrAddProductInfo['price']:$arrAddProductInfo['price02'];
             $arrAddProductInfo['quantity']     = 1;
-            $arrAddProductInfo['tax_rate']     = ($objFormParam->getValue('order_tax_rate') == '')?
-                                                 $this->arrInfo['tax']     :$objFormParam->getValue('order_tax_rate');
-            $arrAddProductInfo['tax_rule']     = ($objFormParam->getValue('order_tax_rule') == '')?
-                                                 $this->arrInfo['tax_rule']:$objFormParam->getValue('order_tax_rule');
+// chenged #2430
+            $order_tax_rate = $objFormParam->getValue('tax_rate');
+            $arrAddProductInfo['tax_rate']     = ($order_tax_rate[0] == '')?
+                                                 $arrTax['tax_rate']:$order_tax_rate[0];
+            $order_tax_rule = $objFormParam->getValue('tax_rule');
+            $arrAddProductInfo['tax_rule']     = ($order_tax_rule[0] == '')?
+                                                 $arrTax['tax_rule']:$order_tax_rule[0];
+// changed #2430
             foreach ($this->arrProductKeys as $insert_key) {
                 $value = $objFormParam->getValue($insert_key);
                 $arrAddProducts[$insert_key]   = (is_array($value))? $value: array();
sumida
投稿日時: 2014/1/17 21:10
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
(ダウンロード商品を扱う予定がないので、あくまで個人的に)
強引にやってみましたが、とりあえず、それらしく動作しているような。

修正案:v2.13.1での修正差分が多いので、掲載していません。

チケット#2428(#2485同件)、 #2451を対策した上で、

1. 商品選択ポップアップ画面(商品の追加、変更)
・受注新規(最初の商品)では、商品種別関係なく一覧表示
・受注新規(上記以外)、受注編集では、1個目の商品の商品種別に絞って一覧表示
・「決定」の時、親ウィンドウに、商品種別を返す。

2. 通常商品は、現状のまま。

3. ダウンロード商品は、(edit.tpl、LC_Page_Admin_Order_Edit.php)
(0) 1.に伴い、呼び出し側にパラメタ追加
(1) 数量欄
   Javascript:quantityCopyForSingleShippingを呼び出さない。
(2) LC_Page_Admin_Order_Edit.php
   shipmentAddProduct:ダウンロード商品用を追加
   shipmentEditProduct:ダウンロード商品用を追加
   doDeleteProduct:ダウンロード商品用を追加
   ただし、商品順序番号は、受注情報の番号を使用(お届け先の番号でない)
nanasess
投稿日時: 2014/1/16 9:55
対応状況: −−−
登録日: 2006/9/9
居住地:
投稿: 2313
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
元々、ダウンロード商品のお届け先の扱いは運用対応としておりました。
(変更、削除、数量などの扱いは dtb_shipment_item には依存していませんでした)

が、 dtb_shipment_item を常に生成するようにしてから整合性が取れなくなっているみたいですね。。

参考スレッド
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=8318&forum=2

本来は dtb_shipment_item に依存すべきではないと思いますが、いかがでしょうか。
とは言え、 現行の 2.13 系での修正は難しいかもしれません。
sumida
投稿日時: 2014/1/15 22:18
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
試しに、「おなべレシピ」のある受注情報を使って、「商品の追加」をしてみた。

追加前:
受注情報  「おなべレシピ」数量「1」
お届け先  情報なし

「おなべレシピ」を追加

追加後:
受注情報  「おなべレシピ」数量「1」のまま
お届け先  「おなべレシピ」でお届け先情報が追加される。
       (お届け先も存在する)

結果:
受注情報編集画面では、ダウンロード商品の編集作業は、考慮されていないようです。
sumida
投稿日時: 2014/1/9 21:06
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
v2.13 管理画面 受注情報編集画面でのダウンロード商品の「変更」「削除」の扱い
チケット#2451(ダウンロード商品)とのからみで思ったのですが、

現状「変更」「削除」ボタンは、shipment_itemに対して実行されるようにHTMLで展開されています。
shipment_itemに展開されないダウンロード商品では、「変更」「削除」ボタンの扱いは、どうすべき?

追記:
数量の変更についても同様に、どうすべき?
スレッド表示 | 古いものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,873名です
総投稿数は110,000件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1646
8
red
1570
9
mcontact
1295
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.