Index: branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php	(revision 21596)
+++ branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php	(revision 21629)
@@ -122,10 +122,11 @@
                 $objPurchase->unsetShippingTemp();
 
-                $success = $this->registerDeliv($arrForm['deliv_check'], $this->tpl_uniqid, $objPurchase, $objCustomer);
+                $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check'];
+                $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer);
                 if (!$success) {
                     SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
                 }
 
-                $objPurchase->setShipmentItemTempForSole($objCartSess);
+                $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH);
@@ -158,5 +159,12 @@
                 exit;
                 break;
+
             default:
+                // 配送IDの取得
+                $shippingData = $objPurchase->getShippingTemp();
+                $arrShippingId = array_keys($shippingData);
+                if (isset($arrShippingId[0])) {
+                    $this->arrForm['deliv_check']['value'] = $arrShippingId[0] == 0 ? -1 : $arrShippingId[0];
+                }
                 break;
         }
@@ -210,5 +218,5 @@
      * お届け先チェックの値が不正な場合は false を返す.
      *
-     * @param integer $deliv_check お届け先チェック
+     * @param integer $other_deliv_id 
      * @param string $uniqid 受注一時テーブルのユニークID
      * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
@@ -216,33 +224,26 @@
      * @return boolean お届け先チェックの値が妥当な場合 true
      */
-    function registerDeliv($deliv_check, $uniqid, &$objPurchase, &$objCustomer) {
+    function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer) {
         GC_Utils_Ex::gfDebugLog('register deliv. deliv_check=' . $deliv_check);
         $arrValues = array();
         // 会員登録住所がチェックされている場合
-        if ($deliv_check == '-1') {
+        if ($other_deliv_id == 0) {
             $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping');
-            $objPurchase->saveShippingTemp($arrValues);
-            $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
-            return true;
         }
         // 別のお届け先がチェックされている場合
-        elseif ($deliv_check >= 1) {
+        else {
             $objQuery =& SC_Query_Ex::getSingletonInstance();
             $arrOtherDeliv = $objQuery->getRow('*', 'dtb_other_deliv',
                                                'customer_id = ? AND other_deliv_id = ?',
-                                               array($objCustomer->getValue('customer_id'), $deliv_check));
-            if (SC_Utils_Ex::isBlank($arrOtherDeliv)) {
+                                               array($objCustomer->getValue('customer_id'), $other_deliv_id));
+            if (empty($arrOtherDeliv)) {
                 return false;
             }
 
             $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', '');
-            $objPurchase->saveShippingTemp($arrValues);
-            $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
-            return true;
-        }
-        // お届け先チェックが不正な場合
-        else {
-            return false;
-        }
+        }
+        $objPurchase->saveShippingTemp($arrValues, $other_deliv_id);
+        $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
+        return true;
     }
 }
Index: branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 21628)
+++ branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 21629)
@@ -108,5 +108,6 @@
 
         // 戻り URL の設定
-        $this->tpl_back_url = $this->getPreviousURL($objCustomer->isLoginSuccess(true), $cart_key, $this->is_multiple);
+        // @deprecated 2.12.0 テンプレート直書きに戻した
+        $this->tpl_back_url = '?mode=return';
 
         $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
@@ -207,5 +208,18 @@
                 $objPlugin->doAction('lc_page_shopping_payment_action_return', array($this));
 
-                SC_Response_Ex::sendRedirect(SHOPPING_URL);
+                $url = null;
+                if ($this->is_multiple) {
+                    $url = MULTIPLE_URLPATH . '?from=multiple';
+                } elseif ($objCustomer->isLoginSuccess(true)) {
+                    if ($product_type_id == PRODUCT_TYPE_DOWNLOAD) {
+                        $url = CART_URLPATH;
+                    } else {
+                        $url = DELIV_URLPATH;
+                    }
+                } else {
+                    $url = SHOPPING_URL . '?from=nonmember';
+                }
+
+                SC_Response_Ex::sendRedirect($url);
                 exit;
                 break;
@@ -441,27 +455,4 @@
 
     /**
-     * 前に戻るボタンの URL を取得する.
-     *
-     * @param boolean $is_login ユーザーがログインしている場合 true
-     * @param integer $product_type_id 商品種別ID
-     * @param boolean $is_multiple 複数配送の場合 true
-     * @return string 前に戻るボタンの URL
-     */
-    function getPreviousURL($is_login = false, $product_type_id, $is_multiple) {
-        if ($is_multiple) {
-            return MULTIPLE_URLPATH . '?from=multiple';
-        }
-        if ($is_login) {
-            if ($product_type_id == PRODUCT_TYPE_DOWNLOAD) {
-                return CART_URLPATH;
-            } else {
-                return DELIV_URLPATH;
-            }
-        } else {
-            return SHOPPING_URL . '?from=nonmember';
-        }
-    }
-
-    /**
      * モバイル用テンプレートのパスを取得する.
      *
Index: branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping.php	(revision 21596)
+++ branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping.php	(revision 21629)
@@ -413,7 +413,7 @@
             }
         } else {
-            $objPurchase->unsetOneShippingTemp();
+            $objPurchase->unsetAllShippingTemp(true);
             if ($arrParams['deliv_check'] == '1') {
-                $objPurchase->saveShippingTemp($arrShipping, 0);
+                $objPurchase->saveShippingTemp($arrShipping, 1);
             } else {
                 $objPurchase->saveShippingTemp($arrShippingOwn, 0);
