Index: branches/version-2_5-dev/data/class/SC_Product.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_Product.php	(revision 19680)
+++ branches/version-2_5-dev/data/class/SC_Product.php	(revision 19688)
@@ -48,5 +48,5 @@
     /** 検索用並び替え条件配列 */
     var $arrOrderData;
-    
+
     /**
      * 商品検索結果の並び順を指定する。
@@ -574,4 +574,22 @@
         // TODO エラーハンドリング
         return true;
+    }
+
+    /**
+     * 引数の商品規格IDで有効な支払方法IDの配列を取得する.
+     *
+     * @param array $productClassIds 商品規格IDの配列
+     * @return array 支払方法IDの配列
+     */
+    function getEnablePaymentIds($productClassIds) {
+        $size = count($productClassIds);
+        $objQuery =& SC_Query::getSingletonInstance();
+        $objQuery->groupby = 'GROUP BY payment_id HAVING COUNT(payment_id) = ?';
+        $paymentIds = $objQuery->getCol('dtb_payment_options', 'payment_id',
+                                        'product_class_id IN (' . implode(', ', array_pad(array(), $size, '?')) . ')',
+                                        array_merge($productClassIds, array($size)),
+                                        MDB2_FETCHMODE_ORDERED);
+        var_dump($productClassIds);
+        return $paymentIds;
     }
 
Index: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 19684)
+++ branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 19688)
@@ -129,4 +129,11 @@
         $this->arrData = $objCartSess->calculate($this->cartKey, $objCustomer);
 
+        // 購入金額の取得
+        $total_inctax = $objCartSess->getAllProductsTotal($this->cartKey);
+
+        // 支払い方法の取得
+        $this->arrPayment = $this->lfGetPayment($total_inctax, $this->cartKey,
+                                                $objCartSess->getAllProductClassID($this->cartKey));
+
         if (!isset($_POST['mode'])) $_POST['mode'] = "";
 
@@ -171,8 +178,4 @@
         }
 
-        // 購入金額の取得
-        $total_inctax = $objCartSess->getAllProductsTotal($this->cartKey);
-        // 支払い方法の取得
-        $this->arrPayment = $this->lfGetPayment($total_inctax);
         // 支払い方法の画像があるなしを取得（$img_show true:ある false:なし）
         $this->img_show = $this->lfGetImgShow($this->arrPayment);
@@ -371,30 +374,15 @@
     }
 
-    function lfGetPayment($total_inctax) {
+    function lfGetPayment($total_inctax, $productTypeId, $productClassIds) {
+
+        // 有効な支払方法を取得
+        $objProduct = new SC_Product();
+        $paymentIds = $objProduct->getEnablePaymentIds($productClassIds);
+        $where = 'del_flg = 0 AND payment_id IN (' . implode(', ', array_pad(array(), count($paymentIds), '?')) . ')';
+
         $objQuery = new SC_Query();
         $objQuery->setOrder("rank DESC");
-
-        //削除されていない支払方法を取得
-        $arrval = null;
-        $where = "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) ";
-
-        //ダウンロード商品の有無判定
-        if($this->cartdown != 0){
-            //ダウンロード商品を含む場合は、オンライン決済以外は選択できない。
-            $arrval = explode(",", ONLINE_PAYMENT);
-            $tmp_where = "";
-            foreach ($arrval as $val) {
-                if($tmp_where == "") {
-                    $tmp_where.= "AND payment_id IN ( ?";
-                } else {
-                    $tmp_where.= ",? ";
-                }
-            }
-            $tmp_where.= " ) ";
-            $where .= $tmp_where;
-        }
-
         // 削除されていない支払方法を取得
-        $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", $where, $arrval);
+        $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", $where, $paymentIds);
 
         // 配列初期化
@@ -402,8 +390,4 @@
         // 選択可能な支払方法を判定
         foreach($arrRet as $data) {
-            //ダウンロード販売に対する注意追加
-            if($this->cartdown != 0){
-                $data['payment_method'] = $data['payment_method'] . "　　（ダウンロード商品を含む場合、オンライン決済のみ選択可能です）";
-            }
             // 下限と上限が設定されている
             if (strlen($data['rule']) != 0 && strlen($data['upper_rule']) != 0) {
@@ -466,5 +450,6 @@
         $total_inctax = $objCartSess->getAllProductsTotal();
         // 支払い方法の取得
-        $arrPayment = $this->lfGetPayment($total_inctax);
+        $arrPayment = $this->lfGetPayment($total_inctax, $this->cartKey,
+                                          $objCartSess->getAllProductClassID($this->cartKey));
         $pay_flag = true;
         foreach ($arrPayment as $key => $payment) {
@@ -485,5 +470,5 @@
         $objQuery = new SC_Query();
         $where = "payment_id = ?";
-        $arrRet = $objQuery->select("charge, deliv_id", "dtb_payment", $where, array($payment_id));
+        $arrRet = $objQuery->select("charge", "dtb_payment", $where, array($payment_id));
         return (array($arrRet[0]['charge'], $arrRet[0]['deliv_id']));
     }
@@ -627,5 +612,5 @@
 
         // 配送時間の取得
-        $arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
+        $arrRet = $objDb->sfGetDelivTime($this->cartKey);
         // JSONエンコード
         echo $objJson->encode($arrRet);
Index: branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php	(revision 19670)
+++ branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php	(revision 19688)
@@ -74,4 +74,5 @@
         $this->arrProductType = $masterData->getMasterData("mtb_product_type");
         $this->arrMaker = SC_Helper_DB_Ex::sfGetIDValueList("dtb_maker", "maker_id", "name");
+        $this->arrPayments = SC_Helper_DB_Ex::sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
         $this->tpl_nonclass = true;
     }
Index: branches/version-2_5-dev/data/class/SC_CartSession.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_CartSession.php	(revision 19680)
+++ branches/version-2_5-dev/data/class/SC_CartSession.php	(revision 19688)
@@ -349,4 +349,20 @@
     }
 
+    /**
+     * カート内にある商品規格IDを全て取得する.
+     *
+     * @param integer $productTypeId 商品種別ID
+     * @return array 商品規格ID の配列
+     */
+    function getAllProductClassID($productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            if($this->cartSession[$productTypeId][$i]['cart_no'] != "") {
+                $arrRet[] = $this->cartSession[$productTypeId][$i]['id'];
+            }
+        }
+        return $arrRet;
+    }
+
     function delAllProducts($productTypeId) {
         $max = $this->getMax($productTypeId);
@@ -499,7 +515,5 @@
         // 配送業者の送料を加算
         if (OPTION_DELIV_FEE == 1) {
-            $results['deliv_fee'] += $objDb->sfGetDelivFee(
-                                             array('deliv_pref' => $deliv_pref,
-                                                   'payment_id' => $payment_id));
+            $results['deliv_fee'] += $objDb->sfGetDelivFee($deliv_pref, $productTypeId);
         }
 
Index: branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 19680)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 19688)
@@ -1484,10 +1484,10 @@
 
     /**
-     * お届け時間を取得する.
-     *
-     * @param integer $payment_id 支払い方法ID
+     * 商品種別からお届け時間を取得する.
+     *
+     * @param integer $productTypeId 商品種別ID
      * @return array お届け時間の配列
      */
-    function sfGetDelivTime($payment_id = "") {
+    function sfGetDelivTime($productTypeId) {
         $objQuery =& SC_Query::getSingletonInstance();
 
@@ -1496,6 +1496,6 @@
 
         if($payment_id != "") {
-            $where = "del_flg = 0 AND payment_id = ?";
-            $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($payment_id));
+            $where = "del_flg = 0 AND product_type_id = ?";
+            $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($productTypeId));
             $deliv_id = $arrRet[0]['deliv_id'];
         }
@@ -1516,25 +1516,6 @@
      * @return string 指定の都道府県, 支払い方法の配送料金
      */
-    function sfGetDelivFee($arrData) {
-        $pref = $arrData['deliv_pref'];
-        $payment_id = isset($arrData['payment_id']) ? $arrData['payment_id'] : "";
-
-        $objQuery =& SC_Query::getSingletonInstance();
-
-        $deliv_id = "";
-
-        // 支払い方法が指定されている場合は、対応した配送業者を取得する
-        if($payment_id != "") {
-            $where = "del_flg = 0 AND payment_id = ?";
-            $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($payment_id));
-            $deliv_id = $arrRet[0]['deliv_id'];
-        // 支払い方法が指定されていない場合は、先頭の配送業者を取得する
-        } else {
-            $where = "del_flg = 0";
-            $objQuery->setOrder("rank DESC");
-            $objQuery->setLimitOffset(1);
-            $arrRet = $objQuery->select("deliv_id", "dtb_deliv", $where);
-            $deliv_id = $arrRet[0]['deliv_id'];
-        }
+    function sfGetDelivFee($pref_id, $product_type_id) {
+        $objQuery =& SC_Query::getSingletonInstance();
 
         // 配送業者から配送料を取得
@@ -1542,11 +1523,11 @@
 
             // 都道府県が指定されていない場合は、東京都の番号を指定しておく
-            if($pref == "") {
-                $pref = 13;
+            if($pref_id == "") {
+                $pref_id = 13;
             }
 
             $objQuery =& SC_Query::getSingletonInstance();
-            $where = "deliv_id = ? AND pref = ?";
-            $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($deliv_id, $pref));
+            $where = "product_type_id = ? AND pref = ?";
+            $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($product_type_id, $pref_id));
         }
         return $arrRet[0]['fee'];
Index: branches/version-2_5-dev/data/Smarty/templates/admin/products/product.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/admin/products/product.tpl	(revision 19670)
+++ branches/version-2_5-dev/data/Smarty/templates/admin/products/product.tpl	(revision 19688)
@@ -197,4 +197,10 @@
     </tr>
     <tr>
+      <th>支払方法</th>
+       <td>
+         <!--{html_checkboxes name="payment_ids" options=$arrPayments selected=$arrForm.payment_ids}-->
+       </td>
+    </tr>
+    <tr>
       <th>ポイント付与率<span class="attention"> *</span></th>
       <td>
