Index: branches/version-2_5-dev/data/Smarty/templates/default/list.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/default/list.tpl	(revision 18833)
+++ branches/version-2_5-dev/data/Smarty/templates/default/list.tpl	(revision 18852)
@@ -74,4 +74,5 @@
     fnSetVal("product_id", productForm["product_id"].value);
     fnSetVal("product_class_id", productForm["product_class_id"].value);
+    fnSetVal("product_type", productForm["product_type"].value);
     fnSubmit();
 }
Index: branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl	(revision 18851)
+++ branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl	(revision 18852)
@@ -71,38 +71,38 @@
                     <th>小計</th>
                 </tr>
-                <!--{section name=cnt loop=$arrProductsClass}-->
+                <!--{foreach from=$cartItems item=item}-->
                 <tr>
                     <td class="phototd">
                         <a
-                            <!--{if $arrProductsClass[cnt][$cartKey].main_image|strlen >= 1}-->
-                                href="<!--{$smarty.const.IMAGE_SAVE_URL}--><!--{$arrProductsClass[cnt][$cartKey].main_image|sfNoImageMainList|escape}-->"
+                            <!--{if $item.productsClass.main_image|strlen >= 1}-->
+                                href="<!--{$smarty.const.IMAGE_SAVE_URL}--><!--{$item.productsClass.main_image|sfNoImageMainList|escape}-->"
                                 class="expansion"
                                 target="_blank"
                             <!--{/if}-->
                         >
-                            <img src="<!--{$smarty.const.URL_DIR}-->resize_image.php?image=<!--{$arrProductsClass[cnt][$cartKey].main_list_image|sfNoImageMainList|escape}-->&amp;width=65&amp;height=65" alt="<!--{$arrProductsClass[cnt][$cartKey].name|escape}-->" /></a>
+                            <img src="<!--{$smarty.const.URL_DIR}-->resize_image.php?image=<!--{$item.productsClass.main_list_image|sfNoImageMainList|escape}-->&amp;width=65&amp;height=65" alt="<!--{$item.productsClass.name|escape}-->" /></a>
                     </td>
                     <td>
                         <ul>
-                            <li><strong><!--{$arrProductsClass[cnt][$cartKey].name|escape}--></strong></li>
-                            <!--{if $arrProductsClass[cnt][$cartKey].classcategory_name1 != ""}-->
-                            <li><!--{$arrProductsClass[cnt][$cartKey].class_name1}-->：<!--{$arrProductsClass[cnt][$cartKey].classcategory_name1}--></li>
+                            <li><strong><!--{$item.productsClass.name|escape}--></strong></li>
+                            <!--{if $item.productsClass.classcategory_name1 != ""}-->
+                            <li><!--{$item.productsClass.class_name1}-->：<!--{$item.productsClass.classcategory_name1}--></li>
                             <!--{/if}-->
-                            <!--{if $arrProductsClass[cnt][$cartKey].classcategory_name2 != ""}-->
-                            <li><!--{$arrProductsClass[cnt][$cartKey].class_name2}-->：<!--{$arrProductsClass[cnt][$cartKey].classcategory_name2}--></li>
+                            <!--{if $item.productsClass.classcategory_name2 != ""}-->
+                            <li><!--{$item.productsClass.class_name2}-->：<!--{$item.productsClass.classcategory_name2}--></li>
                             <!--{/if}-->
                         </ul>
                  </td>
                  <td class="pricetd">
-                 <!--{if $arrProductsClass[cnt][$cartKey].price02 != ""}-->
-                     <!--{$arrProductsClass[cnt][$cartKey].price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
+                 <!--{if $item.productsClass.price02 != ""}-->
+                     <!--{$item.productsClass.price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
                  <!--{else}-->
-                     <!--{$arrProductsClass[cnt][$cartKey].price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
+                     <!--{$item.productsClass.price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
                  <!--{/if}-->
                  </td>
-                 <td><!--{$arrProductsClass[cnt][$cartKey].quantity|number_format}--></td>
-                 <td class="pricetd"><!--{$arrProductsClass[cnt][$cartKey].total_pretax|number_format}-->円</td>
+                 <td><!--{$item.quantity|number_format}--></td>
+                 <td class="pricetd"><!--{$item.total_pretax|number_format}-->円</td>
              </tr>
-             <!--{/section}-->
+             <!--{/foreach}-->
                 <tr>
                     <th colspan="4" class="resulttd">小計</th>
Index: branches/version-2_5-dev/data/Smarty/templates/default/cart/index.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/default/cart/index.tpl	(revision 18836)
+++ branches/version-2_5-dev/data/Smarty/templates/default/cart/index.tpl	(revision 18852)
@@ -70,5 +70,6 @@
     <!--{/if}-->
 
-    <!--{if count($arrProductsClass) > 0}-->
+    <!--{if count($cartItems) > 0}-->
+
     <!--{foreach from=$cartKeys item=key}-->
         <form name="form1" id="form1" method="post" action="?">
@@ -79,4 +80,5 @@
             <input type="hidden" name="mode" value="confirm" />
             <input type="hidden" name="cart_no" value="" />
+            <input type="hidden" name="cartKey" value="<!--{$key}-->" />
             <table summary="商品情報">
                 <tr>
@@ -88,42 +90,42 @@
                     <th>小計</th>
                 </tr>
-                <!--{section name=cnt loop=$arrProductsClass}-->
-                    <tr style="<!--{if $arrProductsClass[cnt].error}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->">
-                        <td><a href="?" onclick="fnModeSubmit('delete', 'cart_no', '<!--{$arrProductsClass[cnt][$key].cart_no}-->'); return false;">削除</a>
+                <!--{foreach from=$cartItems[$key] item=item}-->
+                    <tr style="<!--{if $item.error}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->">
+                        <td><a href="?" onclick="fnModeSubmit('delete', 'cart_no', '<!--{$item.cart_no}-->'); return false;">削除</a>
                         </td>
                         <td class="phototd">
                         <a
-                            <!--{if $arrProductsClass[cnt][$key].main_image|strlen >= 1}-->
-                                href="<!--{$smarty.const.IMAGE_SAVE_URL}--><!--{$arrProductsClass[cnt][$key].main_image|sfNoImageMainList|escape}-->"
+                            <!--{if $item.productsClass.main_image|strlen >= 1}-->
+                                href="<!--{$smarty.const.IMAGE_SAVE_URL}--><!--{$item.productsClass.main_image|sfNoImageMainList|escape}-->"
                                 class="expansion"
                                 target="_blank"
                             <!--{/if}-->
                         >
-                            <img src="<!--{$smarty.const.URL_DIR}-->resize_image.php?image=<!--{$arrProductsClass[cnt][$key].main_list_image|sfNoImageMainList|escape}-->&amp;width=65&amp;height=65" alt="<!--{$arrProductsClass[cnt].name|escape}-->" /></a>
+                            <img src="<!--{$smarty.const.URL_DIR}-->resize_image.php?image=<!--{$item.productsClass.main_list_image|sfNoImageMainList|escape}-->&amp;width=65&amp;height=65" alt="<!--{$item.productsClass.name|escape}-->" /></a>
                         </td>
-                        <td><!--{* 商品名 *}--><strong><!--{$arrProductsClass[cnt][$key].name|escape}--></strong><br />
-                            <!--{if $arrProductsClass[cnt][$key].classcategory_name1 != ""}-->
-                                <!--{$arrProductsClass[cnt][$key].class_name1}-->：<!--{$arrProductsClass[cnt][$key].classcategory_name1}--><br />
+                        <td><!--{* 商品名 *}--><strong><!--{$item.productsClass.name|escape}--></strong><br />
+                            <!--{if $item.productsClass.classcategory_name1 != ""}-->
+                                <!--{$item.productsClass.class_name1}-->：<!--{$item.productsClass.classcategory_name1}--><br />
                             <!--{/if}-->
-                            <!--{if $arrProductsClass[cnt][$key].classcategory_name2 != ""}-->
-                                <!--{$arrProductsClass[cnt][$key].class_name2}-->：<!--{$arrProductsClass[cnt][$key].classcategory_name2}-->
+                            <!--{if $item.productsClass.classcategory_name2 != ""}-->
+                                <!--{$item.productsClass.class_name2}-->：<!--{$item.productsClass.classcategory_name2}-->
                             <!--{/if}-->
                         </td>
                         <td class="pricetd">
-                        <!--{if $arrProductsClass[cnt].price02 != ""}-->
-                            <!--{$arrProductsClass[cnt][$key].price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
+                        <!--{if $item.productsClass.price02 != ""}-->
+                            <!--{$item.productsClass.price02|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
                         <!--{else}-->
-                            <!--{$arrProductsClass[cnt][$key].price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
+                            <!--{$item.productsClass.price01|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}-->円
                         <!--{/if}-->
                         </td>
-                        <td id="quantity"><!--{$arrProductsClass[cnt][$key].quantity}-->
+                        <td id="quantity"><!--{$item.quantity}-->
                             <ul id="quantity_level">
-                                <li><a href="?" onclick="fnModeSubmit('up','cart_no','<!--{$arrProductsClass[cnt][$key].cart_no}-->'); return false"><img src="<!--{$TPL_DIR}-->img/cart/plus.gif" width="16" height="16" alt="＋" /></a></li>
-                                <li><a href="?" onclick="fnModeSubmit('down','cart_no','<!--{$arrProductsClass[cnt][$key].cart_no}-->'); return false"><img src="<!--{$TPL_DIR}-->img/cart/minus.gif" width="16" height="16" alt="-" /></a></li>
+                                <li><a href="?" onclick="fnModeSubmit('up','cart_no','<!--{$item.cart_no}-->'); return false"><img src="<!--{$TPL_DIR}-->img/cart/plus.gif" width="16" height="16" alt="＋" /></a></li>
+                                <li><a href="?" onclick="fnModeSubmit('down','cart_no','<!--{$item.cart_no}-->'); return false"><img src="<!--{$TPL_DIR}-->img/cart/minus.gif" width="16" height="16" alt="-" /></a></li>
                             </ul>
                         </td>
-                        <td class="pricetd"><!--{$arrProductsClass[cnt].total_pretax[$key]|number_format}-->円</td>
+                        <td class="pricetd"><!--{$item.total_pretax|number_format}-->円</td>
                      </tr>
-                 <!--{/section}-->
+                 <!--{/foreach}-->
                  <tr>
                      <th colspan="5" class="resulttd">小計</th>
Index: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php	(revision 18851)
+++ branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php	(revision 18852)
@@ -525,5 +525,6 @@
         $objDb = new SC_Helper_DB_Ex();
         // カート内情報の取得
-        $arrCart = $objCartSess->getCartList();
+        $this->cartKey = $_SESSION['cartKey'];
+        $arrCart = $objCartSess->getCartList($this->cartKey);
         $max = count($arrCart);
 
Index: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php	(revision 18833)
+++ branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php	(revision 18852)
@@ -85,12 +85,30 @@
         // カート集計処理
         $this->cartKey = $_SESSION['cartKey'];
-        $objDb->sfTotalCart($this, $objCartSess, $this->cartKey);
+        $cartItems = $objCartSess->getCartList($this->cartKey);
+        $i = 0;
+        foreach (array_keys($cartItems) as $itemKey) {
+            $cartItem =& $cartItems[$itemKey];
+            if (!SC_Utils_Ex::isBlank($cartItem)) {
+                $this->cartItems[$i] =& $cartItem;
+                $i++;
+            }
+        }
+        $this->tpl_message = $objCartSess->checkProducts($this->cartKey);
+        $this->tpl_total_pretax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey);
+        $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey);
+        // ポイント合計
+        $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey);
+
         if (strlen($this->tpl_message) >= 1) {
             SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true);
         }
+
+        // TODO リファクタリング
         // 一時受注テーブルの読込
-        $arrData = $objDb->sfGetOrderTemp($uniqid);
+        $tmpData = $objDb->sfGetOrderTemp($uniqid);
+
         // カート集計を元に最終計算
-        $arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, null, $objCustomer);
+        $arrData = $objDb->sfTotalConfirm($this->cartItems, $this, $objCartSess, null, $objCustomer, $this->cartKey);
+        $arrData = array_merge($tmpData, $arrData);
         // キャンペーンからの遷移で送料が無料だった場合の処理
         if($objCampaignSess->getIsCampaign()) {
@@ -137,4 +155,6 @@
 
             // 集計結果を受注一時テーブルに反映
+            unset($arrData[0]); // TODO
+            unset($arrData[1]);
             $objDb->sfRegistTempOrder($uniqid, $arrData);
             // 正常に登録されたことを記録しておく
Index: branches/version-2_5-dev/data/class/pages/cart/LC_Page_Cart.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/cart/LC_Page_Cart.php	(revision 18833)
+++ branches/version-2_5-dev/data/class/pages/cart/LC_Page_Cart.php	(revision 18852)
@@ -69,5 +69,4 @@
      */
     function process() {
-        global $objCampaignSess;
 
         $objView = new SC_SiteView(false);
@@ -79,7 +78,22 @@
         $objDb = new SC_Helper_DB_Ex();
         $objProduct = new SC_Product();
-        // 商品購入中にカート内容が変更された。
-        if($objCartSess->getCancelPurchase()) {
-            $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";
+
+        $i = 0;
+        $this->cartKeys = $objCartSess->getKeys();
+        foreach ($this->cartKeys as $key) {
+            // 商品購入中にカート内容が変更された。
+            if($objCartSess->getCancelPurchase($key)) {
+                $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";
+            }
+
+            // カートの商品規格を取得
+            $cartItems = $objCartSess->getCartList($key);
+            foreach (array_keys($cartItems) as $itemKey) {
+                $cartItem =& $cartItems[$itemKey];
+                if (!SC_Utils_Ex::isBlank($cartItem)) {
+                    $this->cartItems[$key][$i] =& $cartItem;
+                    $i++;
+                }
+            }
         }
 
@@ -88,31 +102,21 @@
         switch($_POST['mode']) {
         case 'up':
-            $objCartSess->upQuantity($_POST['cart_no']);
+            $objCartSess->upQuantity($_POST['cart_no'], $_POST['cartKey']);
             $this->reload(); // PRG pattern
             break;
         case 'down':
-            $objCartSess->downQuantity($_POST['cart_no']);
+            $objCartSess->downQuantity($_POST['cart_no'], $_POST['cartKey']);
             $this->reload(); // PRG pattern
             break;
         case 'delete':
-            $objCartSess->delProduct($_POST['cart_no']);
+            $objCartSess->delProduct($_POST['cart_no'], $_POST['cartKey']);
             $this->reload(); // PRG pattern
             break;
         case 'confirm':
             // カート内情報の取得
-            $cartKey = $_POST['cartKey']; // TODO
-            $arrRet = $objCartSess->getCartList($cartKey);
-            $max = count($arrRet);
-            $cnt = 0;
-            for ($i = 0; $i < $max; $i++) {
-                // 商品規格情報の取得
-                $this->arrData = $objProduct->getProductsClass($arrRet[$i]['id']);
-                // DBに存在する商品
-                if($this->arrData != "") {
-                    $cnt++;
-                }
-            }
+            $cartKey = $_POST['cartKey'];
+            $cartList = $objCartSess->getCartList($cartKey);
             // カート商品が1件以上存在する場合
-            if($cnt > 0) {
+            if(count($cartList) > 0) {
                 // 正常に登録されたことを記録しておく
                 $objSiteSess->setRegistFlag();
@@ -141,14 +145,15 @@
         // 基本情報の取得
         $this->arrInfo = $objSiteInfo->data;
-
-        $this->cartKeys = $objCartSess->getKeys();
         foreach ($this->cartKeys as $key) {
             // カート集計処理
-            $objDb->sfTotalCart($this, $objCartSess, $key);
-            $this->arrData = $objDb->sfTotalConfirm($this->arrData, $this, $objCartSess, null, $objCustomer, $key);
+            $this->tpl_message = $objCartSess->checkProducts($key);
+            $this->tpl_total_pretax[$key] = $objCartSess->getAllProductsTotal($key);
+            $this->tpl_total_tax[$key] = $objCartSess->getAllProductsTax($key);
+            // ポイント合計
+            $this->tpl_total_point[$key] = $objCartSess->getAllProductsPoint($key);
+
+            $this->arrData = $objDb->sfTotalConfirm($this->cartItems[$key], $this, $objCartSess, null, $objCustomer, $key);
             // 送料無料までの金額を計算
             $this->tpl_deliv_free[$key] = $this->arrInfo['free_rule'] - $this->tpl_total_pretax[$key];
-
-
         }
 
@@ -159,5 +164,4 @@
             $this->tpl_name = $objCustomer->getValue('name01');
         }
-
 
         // 前頁のURLを取得
Index: branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php	(revision 18701)
+++ branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php	(revision 18852)
@@ -58,26 +58,16 @@
         $objSiteInfo = new SC_SiteInfo;
 
-        if (count($_SESSION[$objCart->key]) > 0){
+        $cartKeys = $objCart->getKeys();
+        foreach ($cartKeys as $cartKey) {
+
             // カート情報を取得
-            $arrCartList = $objCart->getCartList();
+            $arrCartList = $objCart->getCartList($cartKey);
 
             // カート内の商品ＩＤ一覧を取得
-            $arrAllProductID = $objCart->getAllProductID();
+            $arrAllProductID = $objCart->getAllProductID($cartKey);
             // 商品が1つ以上入っている場合には商品名称を取得
-            if (count($arrAllProductID) > 0){
-                $objQuery = new SC_Query();
-                $arrVal = array();
-                $sql = "";
-                $sql = "SELECT name FROM dtb_products WHERE product_id IN ( ?";
-                $arrVal = array($arrAllProductID[0]);
-                for($i = 1 ; $i < count($arrAllProductID) ; $i++){
-                    $sql.= " ,? ";
-                    array_push($arrVal, $arrAllProductID[$i]);
-                }
-                $sql.= " )";
+            if (count($arrCartList) > 0){
 
-                $arrProduct_name = $objQuery->getAll($sql, $arrVal);
-
-                foreach($arrProduct_name as $key => $val){
+                foreach($arrCartList['productsClass'] as $key => $val){
                     $arrCartList[$key]['product_name'] = $val['name'];
                 }
@@ -86,8 +76,8 @@
             $arrInfo = $objSiteInfo->data;
             // 購入金額合計
-            $ProductsTotal = $objCart->getAllProductsTotal();
+            $ProductsTotal = $objCart->getAllProductsTotal($cartKey);
 
             // 合計数量
-            $TotalQuantity = $objCart->getTotalQuantity();
+            $TotalQuantity = $objCart->getTotalQuantity($cartKey);
 
             // 送料無料までの金額
Index: branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 18833)
+++ branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 18852)
@@ -158,6 +158,7 @@
                 $objProduct = new SC_Product();
                 $product_class_id = $this->arrForm['product_class_id'];
+                $product_type = $this->arrForm['product_type'];
                 $objCartSess = new SC_CartSession();
-                $objCartSess->addProduct($product_class_id, $this->arrForm['quantity']);
+                $objCartSess->addProduct($product_class_id, $this->arrForm['quantity'], $product_type);
                 $this->sendRedirect($this->getLocation(URL_CART_TOP));
                 exit;
Index: branches/version-2_5-dev/data/class/SC_CartSession.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_CartSession.php	(revision 18851)
+++ branches/version-2_5-dev/data/class/SC_CartSession.php	(revision 18852)
@@ -24,46 +24,53 @@
 /* カートセッション管理クラス */
 class SC_CartSession {
-    var $key_tmp;	// ユニークIDを指定する。
+    /** ユニークIDを指定する. */
+    var $key_tmp;
+
+    /** カートのセッション変数. */
+    var $cartSession;
 
     /* コンストラクタ */
-    function SC_CartSession() {
+    function SC_CartSession($cartKey = "cart") {
+        $this->cartSession =& $_SESSION[$cartKey];
     }
 
     // 商品購入処理中のロック
-    function saveCurrentCart($key_tmp, $key) {
+    function saveCurrentCart($key_tmp, $productTypeId) {
         $this->key_tmp = "savecart_" . $key_tmp;
         // すでに情報がなければ現状のカート情報を記録しておく
         if(count($_SESSION[$this->key_tmp]) == 0) {
-            $_SESSION[$this->key_tmp] = $_SESSION[$key];
+            $_SESSION[$this->key_tmp] = $this->cartSession[$productTypeId];
         }
         // 1世代古いコピー情報は、削除しておく
         foreach($_SESSION as $k => $val) {
             if($k != $this->key_tmp && preg_match("/^savecart_/", $k)) {
-                unset($_SESSION[$key][$k]);
-            }
-        }
-        $this->registerKey($key);
+                unset($this->cartSession[$productTypeId][$k]);
+            }
+        }
+        $this->registerKey($productTypeId);
     }
 
     // 商品購入中の変更があったかをチェックする。
-    function getCancelPurchase($key) {
-        $this->addKey($key);
-        $ret = isset($_SESSION[$key]['cancel_purchase'])
-            ? $_SESSION[$key]['cancel_purchase'] : "";
-        $_SESSION[$key]['cancel_purchase'] = false;
+    function getCancelPurchase($productTypeId) {
+        $ret = isset($this->cartSession[$productTypeId]['cancel_purchase'])
+            ? $this->cartSession[$productTypeId]['cancel_purchase'] : "";
+        $this->cartSession[$productTypeId]['cancel_purchase'] = false;
         return $ret;
     }
 
     // 購入処理中に商品に変更がなかったかを判定
-    function checkChangeCart($key) {
-        $this->addKey($key);
+    function checkChangeCart($productTypeId) {
         $change = false;
-        $max = $this->getMax();
+        $max = $this->getMax($productTypeId);
         for($i = 1; $i <= $max; $i++) {
-            if ($_SESSION[$key][$i]['quantity'] != $_SESSION[$this->key_tmp][$i]['quantity']) {
+            if ($this->cartSession[$productTypeId][$i]['quantity']
+                != $_SESSION[$this->key_tmp][$i]['quantity']) {
+
                 $change = true;
                 break;
             }
-            if ($_SESSION[$key][$i]['id'] != $_SESSION[$this->key_tmp][$i]['id']) {
+            if ($this->cartSession[$productTypeId][$i]['id']
+                != $_SESSION[$this->key_tmp][$i]['id']) {
+
                 $change = true;
                 break;
@@ -73,16 +80,15 @@
             // 一時カートのクリア
             unset($_SESSION[$this->key_tmp]);
-            $_SESSION[$key]['cancel_purchase'] = true;
+            $this->cartSession[$productTypeId][$key]['cancel_purchase'] = true;
         } else {
-            $_SESSION[$key]['cancel_purchase'] = false;
-        }
-        return $_SESSION[$key]['cancel_purchase'];
+            $this->cartSession[$productTypeId]['cancel_purchase'] = false;
+        }
+        return $this->cartSession[$productTypeId]['cancel_purchase'];
     }
 
     // 次に割り当てるカートのIDを取得する
-    function getNextCartID($key) {
-        $this->addKey($key);
-        foreach($_SESSION[$key] as $k => $val){
-            $arrRet[] = $_SESSION[$key][$k]['cart_no'];
+    function getNextCartID($productTypeId) {
+        foreach($this->cartSession[$productTypeId] as $key => $val){
+            $arrRet[] = $this->cartSession[$productTypeId][$key]['cart_no'];
         }
         return (max($arrRet) + 1);
@@ -95,15 +101,15 @@
      * @param integer $id
      * @return string 商品ごとの合計価格(税込み)
+     * @deprecated SC_CartSession::getCartList() を使用してください
      */
-    function getProductTotal($id, $key) {
-        $this->addKey($key);
-        $max = $this->getMax();
-        for($i = 0; $i <= $max; $i++) {
-            if(isset($_SESSION[$key][$i]['id'])
-               && $_SESSION[$key][$i]['id'] == $id) {
+    function getProductTotal($id, $productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            if(isset($this->cartSession[$productTypeId][$i]['id'])
+               && $this->cartSession[$productTypeId][$i]['id'] == $id) {
 
                 // 税込み合計
-                $price = $_SESSION[$key][$i]['price'];
-                $quantity = $_SESSION[$key][$i]['quantity'];
+                $price = $this->cartSession[$productTypeId][$i]['price'];
+                $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
                 $pre_tax = SC_Helper_DB_Ex::sfPreTax($price);
                 $total = $pre_tax * $quantity;
@@ -115,11 +121,10 @@
 
     // 値のセット
-    function setProductValue($id, $k, $val, $key) {
-        $this->addKey($key);
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            if(isset($_SESSION[$key][$i]['id'])
-               && $_SESSION[$key][$i]['id'] == $id) {
-                $_SESSION[$key][$i][$k] = $val;
+    function setProductValue($id, $key, $val, $productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            if(isset($this->cartSession[$productTypeId][$i]['id'])
+               && $this->cartSession[$productTypeId][$i]['id'] == $id) {
+                $this->cartSession[$productTypeId][$i][$key] = $val;
             }
         }
@@ -127,14 +132,11 @@
 
     // カート内商品の最大要素番号を取得する。
-    function getMax($key) {
-        $this->addKey($key);
-        $cnt = 0;
-        $pos = 0;
+    function getMax($productTypeId) {
         $max = 0;
-        if (count($_SESSION[$key]) > 0){
-            foreach($_SESSION[$key] as $k => $val) {
-                if (is_numeric($k)) {
-                    if($max < $k) {
-                        $max = $k;
+        if (count($this->cartSession[$productTypeId]) > 0){
+            foreach($this->cartSession[$productTypeId] as $key => $val) {
+                if (is_numeric($key)) {
+                    if($max < $key) {
+                        $max = $key;
                     }
                 }
@@ -145,10 +147,9 @@
 
     // カート内商品数の合計
-    function getTotalQuantity($key) {
-        $this->addKey($key);
+    function getTotalQuantity($productTypeId) {
         $total = 0;
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            $total+= $_SESSION[$key][$i]['quantity'];
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            $total+= $this->cartSession[$productTypeId][$i]['quantity'];
         }
         return $total;
@@ -157,20 +158,20 @@
 
     // 全商品の合計価格
-    function getAllProductsTotal($key) {
-        $this->addKey($key);
+    function getAllProductsTotal($productTypeId) {
         // 税込み合計
         $total = 0;
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-
-            if (!isset($_SESSION[$key][$i]['price'])) {
-                $_SESSION[$key][$i]['price'] = "";
-            }
-            $price = $_SESSION[$key][$i]['price'];
-
-            if (!isset($_SESSION[$key][$i]['quantity'])) {
-                $_SESSION[$key][$i]['quantity'] = "";
-            }
-            $quantity = $_SESSION[$key][$i]['quantity'];
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+
+            if (!isset($this->cartSession[$productTypeId][$i]['price'])) {
+                $this->cartSession[$productTypeId][$i]['price'] = "";
+            }
+
+            $price = $this->cartSession[$productTypeId][$i]['price'];
+
+            if (!isset($this->cartSession[$productTypeId][$i]['quantity'])) {
+                $this->cartSession[$productTypeId][$i]['quantity'] = "";
+            }
+            $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
 
             $pre_tax = SC_Helper_DB_Ex::sfPreTax($price);
@@ -181,12 +182,11 @@
 
     // 全商品の合計税金
-    function getAllProductsTax($key) {
-        $this->addKey($key);
+    function getAllProductsTax($productTypeId) {
         // 税合計
         $total = 0;
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            $price = $_SESSION[$key][$i]['price'];
-            $quantity = $_SESSION[$key][$i]['quantity'];
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            $price = $this->cartSession[$productTypeId][$i]['price'];
+            $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
             $tax = SC_Helper_DB_Ex::sfTax($price);
             $total+= ($tax * $quantity);
@@ -196,23 +196,22 @@
 
     // 全商品の合計ポイント
-    function getAllProductsPoint($key) {
-        $this->addKey($key);
+    function getAllProductsPoint($productTypeId) {
         // ポイント合計
         $total = 0;
         if (USE_POINT !== false) {
-            $max = $this->getMax($key);
+            $max = $this->getMax($productTypeId);
             for($i = 0; $i <= $max; $i++) {
-                $price = $_SESSION[$key][$i]['price'];
-                $quantity = $_SESSION[$key][$i]['quantity'];
-
-                if (!isset($_SESSION[$key][$i]['point_rate'])) {
-                    $_SESSION[$key][$i]['point_rate'] = "";
-                }
-                $point_rate = $_SESSION[$key][$i]['point_rate'];
-
-                if (!isset($_SESSION[$key][$i]['id'][0])) {
-                    $_SESSION[$key][$i]['id'][0] = "";
-                }
-                $id = $_SESSION[$key][$i]['id'][0];
+                $price = $this->cartSession[$productTypeId][$i]['price'];
+                $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
+
+                if (!isset($this->cartSession[$productTypeId][$i]['point_rate'])) {
+                    $this->cartSession[$productTypeId][$i]['point_rate'] = "";
+                }
+                $point_rate = $this->cartSession[$productTypeId][$i]['point_rate'];
+
+                if (!isset($this->cartSession[$productTypeId][$i]['id'][0])) {
+                    $this->cartSession[$productTypeId][$i]['id'][0] = "";
+                }
+                $id = $this->cartSession[$productTypeId][$i]['id'][0];
                 $point = SC_Utils_Ex::sfPrePoint($price, $point_rate, POINT_RULE, $id);
                 $total+= ($point * $quantity);
@@ -223,14 +222,13 @@
 
     // カートへの商品追加
-    function addProduct($id, $quantity, $key) {
-        $this->addKey($key);
+    function addProduct($id, $quantity, $productTypeId) {
         $find = false;
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-
-            if($_SESSION[$key][$i]['id'] == $id) {
-                $val = $_SESSION[$key][$i]['quantity'] + $quantity;
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+
+            if($this->cartSession[$productTypeId][$i]['id'] == $id) {
+                $val = $this->cartSession[$productTypeId][$i]['quantity'] + $quantity;
                 if(strlen($val) <= INT_LEN) {
-                    $_SESSION[$key][$i]['quantity']+= $quantity;
+                    $this->cartSession[$productTypeId][$i]['quantity'] += $quantity;
                 }
                 $find = true;
@@ -238,13 +236,12 @@
         }
         if(!$find) {
-            $_SESSION[$key][$max+1]['id'] = $id;
-            $_SESSION[$key][$max+1]['quantity'] = $quantity;
-            $_SESSION[$key][$max+1]['cart_no'] = $this->getNextCartID($key);
+            $this->cartSession[$productTypeId][$max+1]['id'] = $id;
+            $this->cartSession[$productTypeId][$max+1]['quantity'] = $quantity;
+            $this->cartSession[$productTypeId][$max+1]['cart_no'] = $this->getNextCartID($productTypeId);
         }
     }
 
     // 前頁のURLを記録しておく
-    function setPrevURL($url, $key) {
-        $this->addKey($key);
+    function setPrevURL($url) {
         // 前頁として記録しないページを指定する。
         $arrExclude = array(
@@ -254,5 +251,5 @@
         // ページチェックを行う。
         foreach($arrExclude as $val) {
-            if(ereg($val, $url)) {
+            if(preg_match("/" . preg_quote($val) . "/", $url)) {
                 $exclude = true;
                 break;
@@ -261,44 +258,59 @@
         // 除外ページでない場合は、前頁として記録する。
         if(!$exclude) {
-            $_SESSION[$key]['prev_url'] = $url;
+            $_SESSION['prev_url'] = $url;
         }
     }
 
     // 前頁のURLを取得する
-    function getPrevURL($key) {
-        $this->addKey($key);
-        return isset($_SESSION[$key]['prev_url'])
-            ? $_SESSION[$key]['prev_url'] : "";
+    function getPrevURL() {
+        return isset($_SESSION['prev_url']) ? $_SESSION['prev_url'] : "";
     }
 
     // キーが一致した商品の削除
-    function delProductKey($keyname, $val, $key) {
-        $this->addKey($key);
-        $max = count($_SESSION[$key]);
+    function delProductKey($keyname, $val, $productTypeId) {
+        $max = count($this->cartSession[$productTypeId]);
         for($i = 0; $i < $max; $i++) {
-            if($_SESSION[$key][$i][$keyname] == $val) {
-                unset($_SESSION[$key][$i]);
-            }
-        }
-    }
-
-    function setValue($k, $val, $key) {
-        $this->addKey($key);
-        $_SESSION[$key][$k] = $val;
-    }
-
-    function getValue($k, $key) {
-        $this->addKey($key);
-        return $_SESSION[$key][$k];
-    }
-
-    function getCartList($key) {
-        $this->addKey($key);
-        $max = $this->getMax($key);
+            if($this->cartSession[$productTypeId][$i][$keyname] == $val) {
+                unset($this->cartSession[$productTypeId][$i]);
+            }
+        }
+    }
+
+    function setValue($key, $val, $productTypeId) {
+        $this->cartSession[$productTypeId][$key] = $val;
+    }
+
+    function getValue($key, $productTypeId) {
+        return $this->cartSession[$productTypeId][$key];
+    }
+
+    function getCartList($productTypeId) {
+        $objProduct = new SC_Product();
+        $max = $this->getMax($productTypeId);
         $arrRet = array();
         for($i = 0; $i <= $max; $i++) {
-            if(isset($_SESSION[$key][$i]['cart_no'])
-               && $_SESSION[$key][$i]['cart_no'] != "") {
-                $arrRet[] = $_SESSION[$key][$i];
+            if(isset($this->cartSession[$productTypeId][$i]['cart_no'])
+               && $this->cartSession[$productTypeId][$i]['cart_no'] != "") {
+
+                if (SC_Utils_Ex::isBlank($this->cartSession[$productTypeId][$i]['productsClass'])) {
+                    $this->cartSession[$productTypeId][$i]['productsClass'] =&
+                            $objProduct->getDetailAndProductsClass(
+                                    $this->cartSession[$productTypeId][$i]['id']);
+                }
+
+                $price = $this->cartSession[$productTypeId][$i]['productsClass']['price02'];
+                $this->cartSession[$productTypeId][$i]['price'] = $price;
+
+                $this->cartSession[$productTypeId][$i]['point_rate'] =
+                        $this->cartSession[$productTypeId][$i]['productsClass']['point_rate'];
+
+
+                $quantity = $this->cartSession[$productTypeId][$i]['quantity'];
+                $pre_tax = SC_Helper_DB_Ex::sfPreTax($price);
+                $total = $pre_tax * $quantity;
+
+                $this->cartSession[$productTypeId][$i]['total_pretax'] = $total;
+
+                $arrRet[] =& $this->cartSession[$productTypeId][$i];
             }
         }
@@ -307,10 +319,9 @@
 
     // カート内にある商品ＩＤを全て取得する
-    function getAllProductID($key) {
-        $this->addKey($key);
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            if($_SESSION[$key][$i]['cart_no'] != "") {
-                $arrRet[] = $_SESSION[$key][$i]['id'][0];
+    function getAllProductID($productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            if($this->cartSession[$productTypeId][$i]['cart_no'] != "") {
+                $arrRet[] = $this->cartSession[$productTypeId][$i]['id'][0];
             }
         }
@@ -318,19 +329,17 @@
     }
 
-    function delAllProducts($key) {
-        $this->addKey($key);
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            unset($_SESSION[$key][$i]);
+    function delAllProducts($productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            unset($this->cartSession[$productTypeId][$i]);
         }
     }
 
     // 商品の削除
-    function delProduct($cart_no, $key) {
-        $this->addKey($key);
-        $max = $this->getMax($key);
-        for($i = 0; $i <= $max; $i++) {
-            if($_SESSION[$key][$i]['cart_no'] == $cart_no) {
-                unset($_SESSION[$key][$i]);
+    function delProduct($cart_no, $productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for($i = 0; $i <= $max; $i++) {
+            if($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
+                unset($this->cartSession[$productTypeId][$i]);
             }
         }
@@ -338,37 +347,95 @@
 
     // 数量の増加
-    function upQuantity($cart_no, $key) {
-        $this->addKey($key);
-        $max = $this->getMax();
-        for($i = 0; $i <= $max; $i++) {
-            if($_SESSION[$key][$i]['cart_no'] == $cart_no) {
-                if(strlen($_SESSION[$key][$i]['quantity'] + 1) <= INT_LEN) {
-                    $_SESSION[$key][$i]['quantity']++;
-                }
-            }
+    function upQuantity($cart_no, $productTypeId) {
+        $quantity = $this->getQuantity($cart_no, $productTypeId);
+        if (strlen($quantity + 1) <= INT_LEN) {
+            $this->setQuantity($quantity + 1, $cart_no, $productTypeId);
         }
     }
 
     // 数量の減少
-    function downQuantity($cart_no, $key) {
-        $this->addKey($key);
-        $max = $this->getMax();
-        for($i = 0; $i <= $max; $i++) {
-            if($_SESSION[$key][$i]['cart_no'] == $cart_no) {
-                if($_SESSION[$key][$i]['quantity'] > 1) {
-                    $_SESSION[$key][$i]['quantity']--;
-                }
-            }
-        }
-    }
-
-    function addKey($key) {
-        if (!in_array($this->keys, $key)) {
-            $this->keys[] = $key;
-        }
+    function downQuantity($cart_no, $productTypeId) {
+        $quantity = $this->getQuantity($cart_no, $productTypeId);
+        if ($quantity > 1) {
+            $this->setQuantity($quantity - 1, $cart_no, $productTypeId);
+        }
+    }
+
+    function getQuantity($cart_no, $productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for ($i = 0; $i <= $max; $i++) {
+            if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
+                return $this->cartSession[$productTypeId][$i]['quantity'];
+            }
+        }
+    }
+
+    function setQuantity($quantity, $cart_no, $productTypeId) {
+        $max = $this->getMax($productTypeId);
+        for ($i = 0; $i <= $max; $i++) {
+            if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
+                $this->cartSession[$productTypeId][$i]['quantity'] = $quantity;
+            }
+        }
+    }
+
+    function getProductClassId($cart_no, $productTypeId) {
+        for ($i = 0; $i <= $max; $i++) {
+            if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
+                return $this->cartSession[$productTypeId][$i]['id'];
+            }
+        }
+    }
+
+    /**
+     * カート内の商品の妥当性をチェックする.
+     *
+     * エラーが発生した場合は, 商品をカート内から削除又は数量を調整し,
+     * エラーメッセージを返す.
+     *
+     * 1. 削除/非表示商品のチェック
+     * 2. 商品購入制限数のチェック
+     * 3. 在庫数チェック
+     *
+     * @param string $key 商品種別ID
+     * @return string エラーが発生した場合はエラーメッセージ
+     */
+    function checkProducts($productTypeId) {
+        $objProduct = new SC_Product();
+        $tpl_message = "";
+
+        // カート内の情報を取得
+        $items = $this->getCartList($productTypeId);
+        foreach (array_keys($items) as $key) {
+            $item =& $items[$key];
+            $product =& $item['productsClass'];
+            /*
+             * 表示/非表示商品のチェック
+             */
+            if (SC_Utils_Ex::isBlank($product)) {
+                $this->delProduct($item['cart_no'], $productTypeId);
+                $tpl_message .= "※ 現時点で販売していない商品が含まれておりました。該当商品をカートから削除しました。\n";
+            }
+
+            /*
+             * 商品購入制限数, 在庫数のチェック
+             */
+            $limit = $objProduct->getBuyLimit($product);
+            if (!is_null($limit) && $item['quantity'] > $limit) {
+                if ($limit > 0) {
+                    $this->setProductValue($item['id'], 'quantity', $limit, $productTypeId);
+                    $tpl_message .= "※「" . $product['name'] . "」は販売制限(または在庫が不足)しております。一度に数量{$limit}以上の購入はできません。\n";
+                } else {
+                    $this->delProduct($item['cart_no'], $productTypeId);
+                    $tpl_message .= "※「" . $product['name'] . "」は売り切れました。\n";
+                    continue;
+                }
+            }
+        }
+        return $tpl_message;
     }
 
     function getKeys() {
-        return $this->keys;
+        return array_keys($this->cartSession);
     }
 
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 18851)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 18852)
@@ -244,4 +244,5 @@
      * @param null $dummy1 互換性確保用(決済モジュール互換のため)
      * @return LC_Page 集計処理後のページクラスインスタンス
+     * @deprecated SC_CartSession クラスを使用して下さい
      */
     function sfTotalCart(&$objPage, $objCartSess, $dummy1 = null, $key = "") {
@@ -1913,5 +1914,5 @@
      * @return  bool        0:実商品のみ 1:ダウンロード販売と実商品混在 2:全てダウンロード販売
      */
-    function chkCartDown($objCartSess) {
+    function chkCartDown(&$objCartSess, $cartKey = 1) {
         $objQuery =& SC_Query::getSingletonInstance();
         $down = false;
Index: branches/version-2_5-dev/data/class/SC_Product.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_Product.php	(revision 18833)
+++ branches/version-2_5-dev/data/class/SC_Product.php	(revision 18852)
@@ -188,5 +188,5 @@
                 $stock_find_class = ($productsClass['stock_unlimited'] || $productsClass['stock'] > 0);
 
-                $classCategories[$productsClass1][$productsClass2]['name'] = $productsClass['name2'] . ($stock_find_class ? '' : ' (品切れ中)');
+                $classCategories[$productsClass1][$productsClass2]['name'] = $productsClass['classcategory_name2'] . ($stock_find_class ? '' : ' (品切れ中)');
 
                 $classCategories[$productsClass1][$productsClass2]['stock_find'] = $stock_find_class;
@@ -197,5 +197,5 @@
 
                 if (!in_array($classcat_id1, $classCats1)) {
-                    $classCats1[$productsClass1] = $productsClass['name1']
+                    $classCats1[$productsClass1] = $productsClass['classcategory_name1']
                         . ($productsClass2 == 0 && !$stock_find_class ? ' (品切れ中)' : '');
                 }
@@ -258,5 +258,5 @@
             T2.classcategory_id,
             T2.level,
-            T3.name,
+            T3.name AS classcategory_name,
             T4.name AS class_name,
             T4.class_id
@@ -290,5 +290,5 @@
                 T1.parent_class_combination_id,
                 T1.level,
-                T2.name,
+                T2.name AS classcategory_name,
                 T3.name AS class_name,
                 T3.class_id
@@ -325,5 +325,5 @@
             $val['class_id' . $val['level']] = $val['class_id'];
             $val['class_name' . $val['level']] = $val['class_name'];
-            $val['name' . $val['level']] = $val['name'];
+            $val['classcategory_name' . $val['level']] = $val['classcategory_name'];
             $val['classcategory_id' . $val['level']] = $val['classcategory_id'];
             $arrProductsClass[] = $val;
@@ -421,4 +421,25 @@
         }
         return $productsClass;
+    }
+
+    /**
+     * 商品詳細の結果から, 購入制限数を取得する.
+     *
+     * getDetailAndProductsClass() の結果から, 購入制限数を取得する.
+     *
+     * @param array $p 商品詳細の検索結果の配列
+     * @return integer 商品詳細の結果から求めた購入制限数.
+     * @see getDetailAndProductsClass()
+     */
+    function getBuyLimit($p) {
+        $limit = null;
+        if ($p['stock_unlimited'] != '1' && is_numeric($p['sale_limit'])) {
+            $limit = min($p['sale_limit'], $p['stock']);
+        } elseif (is_numeric($p['sale_limit'])) {
+            $limit = $p['sale_limit'];
+        } elseif ($p['stock_unlimited'] != '1') {
+            $limit = $p['stock'];
+        }
+        return $limit;
     }
 
Index: branches/version-2_5-dev/data/class/util/SC_Utils.php
===================================================================
--- branches/version-2_5-dev/data/class/util/SC_Utils.php	(revision 18820)
+++ branches/version-2_5-dev/data/class/util/SC_Utils.php	(revision 18852)
@@ -313,26 +313,31 @@
         // ユーザユニークIDの取得
         $uniqid = $objSiteSess->getUniqId();
-        // 購入ボタンを押した時のカート内容がコピーされていない場合のみコピーする。
-        $objCartSess->saveCurrentCart($uniqid);
-        // POSTのユニークIDとセッションのユニークIDを比較(ユニークIDがPOSTされていない場合はスルー)
-        $ret = $objSiteSess->checkUniqId();
-        if($ret != true) {
-            // エラーページの表示
-            SC_Utils_Ex::sfDispSiteError(CANCEL_PURCHASE, $objSiteSess);
-        }
-
-        // カート内が空でないか || 購入ボタンを押してから変化がないか
-        $quantity = $objCartSess->getTotalQuantity();
-        $ret = $objCartSess->checkChangeCart();
-        if($ret == true || !($quantity > 0)) {
-            // カート情報表示に強制移動する
-            // FIXME false を返して, Page クラスで遷移させるべき...
-            if (defined("MOBILE_SITE")) {
-                header("Location: ". MOBILE_URL_CART_TOP
-                       . "?" . session_name() . "=" . session_id());
-            } else {
-                header("Location: ".URL_CART_TOP);
-            }
-            exit;
+
+        $cartkeys = $objCartSess->getKeys();
+
+        foreach ($cartKeys as $cartKey) {
+            // 購入ボタンを押した時のカート内容がコピーされていない場合のみコピーする。
+            $objCartSess->saveCurrentCart($uniqid, $cartKey);
+            // POSTのユニークIDとセッションのユニークIDを比較(ユニークIDがPOSTされていない場合はスルー)
+            $ret = $objSiteSess->checkUniqId();
+            if($ret != true) {
+                // エラーページの表示
+                SC_Utils_Ex::sfDispSiteError(CANCEL_PURCHASE, $objSiteSess);
+            }
+
+            // カート内が空でないか || 購入ボタンを押してから変化がないか
+            $quantity = $objCartSess->getTotalQuantity($cartKey);
+            $ret = $objCartSess->checkChangeCart($cartKey);
+            if($ret == true || !($quantity > 0)) {
+                // カート情報表示に強制移動する
+                // FIXME false を返して, Page クラスで遷移させるべき...
+                if (defined("MOBILE_SITE")) {
+                    header("Location: ". MOBILE_URL_CART_TOP
+                           . "?" . session_name() . "=" . session_id());
+                } else {
+                    header("Location: ".URL_CART_TOP);
+                }
+                exit;
+            }
         }
         return $uniqid;
