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%" />