Ignore:
Timestamp:
2011/02/09 16:59:25 (13 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20110209054704-w9inyl5j79vady69
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/default/shopping/confirm.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fshopping%2Fconfirm.tpl
data/Smarty/templates/mobile/shopping/confirm.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fmobile%2Fshopping%2Fconfirm.tpl
data/Smarty/templates/sphone/shopping/confirm.tpl confirm.tpl-20101209134550-lsv02w9wikfx9cj3-35
data/class/SC_Customer.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Customer.php
data/class/pages/shopping/LC_Page_Shopping.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping.php
data/class/pages/shopping/LC_Page_Shopping_Confirm.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Confirm.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110209075921-fqrnsifl8w00n1tb
bzr:revno:
2850
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-revisions:

data/Smarty/templates/default/shopping/confirm.tpl ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
data/Smarty/templates/mobile/shopping/confirm.tpl ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
data/Smarty/templates/sphone/shopping/confirm.tpl ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
data/class/SC_Customer.php ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
data/class/pages/shopping/LC_Page_Shopping.php ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
data/class/pages/shopping/LC_Page_Shopping_Confirm.php ohkouchi@loop-az.jp-20110209075616-w6oj8pxw5211fi84
bzr:timestamp:
2011-02-09 16:59:21.723000050 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-02-09T07:59:21.723000Z
Message:

#984([フロント]商品購入 リファクタリング)

  • /shopping/complete.php

#1002(携帯アドレスが登録されていないユーザーが携帯アドレス登録画面に遷移しない)

  • typo 修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php

    r20116 r20122  
    7878        $objPurchase = new SC_Helper_Purchase_Ex(); 
    7979 
    80         $this->isMultiple = $objPurchase->isMultiple(); 
     80        $this->is_multiple = $objPurchase->isMultiple(); 
    8181 
    8282        // 前のページで正しく登録手続きが行われた記録があるか判定 
     
    8686 
    8787        // ユーザユニークIDの取得と購入状態の正当性をチェック 
    88         $uniqid = $objSiteSess->getUniqId(); 
    89         $objPurchase->verifyChangeCart($uniqid, $objCartSess); 
    90         $this->tpl_uniqid = $uniqid; 
     88        $this->tpl_uniqid = $objSiteSess->getUniqId(); 
     89        $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); 
    9190 
    9291        $this->cartKey = $objCartSess->getKey(); 
     
    9493        // カート内商品のチェック 
    9594        $this->tpl_message = $objCartSess->checkProducts($this->cartKey); 
    96         if (strlen($this->tpl_message) >= 1) { 
     95        if (!SC_Utils_Ex::isBlank($this->tpl_message)) { 
    9796            SC_Response_Ex::sendRedirect(CART_URLPATH); 
    9897            exit; 
     
    10099 
    101100        // カートの商品を取得 
    102         $this->cartItems = $objCartSess->getCartList($this->cartKey); 
     101        $this->arrShipping = $objPurchase->getShippingTemp(); 
     102        $this->arrCartItems = $objCartSess->getCartList($this->cartKey); 
    103103        // 合計金額 
    104104        $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey); 
     
    108108        $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey); 
    109109 
    110         // TODO リファクタリング 
    111110        // 一時受注テーブルの読込 
    112         $tmpData = $objPurchase->getOrderTemp($uniqid); 
     111        $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); 
    113112 
    114113        // カート集計を元に最終計算 
    115         // FIXME 使用ポイント, 手数料の扱い 
    116         $arrData = array_merge($tmpData, $objCartSess->calculate($this->cartKey, $objCustomer, $tmpData['use_point'], $objPurchase->getShippingPref(), $tmpData['charge'], $tmpData['discount'])); 
     114        $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, 
     115                                                  $arrOrderTemp['use_point'], 
     116                                                  $objPurchase->getShippingPref(), 
     117                                                  $arrOrderTemp['charge'], 
     118                                                  $arrOrderTemp['discount']); 
     119        $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); 
    117120 
    118121        // 会員ログインチェック 
     
    122125        } 
    123126 
    124         // 決済区分を取得する 
    125         $payment_type = ""; 
    126         if($objDb->sfColumnExists("dtb_payment", "memo01")){ 
    127             // MEMO03に値が入っている場合には、モジュール追加されたものとみなす 
    128             $sql = "SELECT memo03 FROM dtb_payment WHERE payment_id = ?"; 
    129             $arrPayment = $objQuery->getAll($sql, array($arrData['payment_id'])); 
    130             $payment_type = $arrPayment[0]["memo03"]; 
    131         } 
    132         $this->payment_type = $payment_type; 
    133  
    134         $this->shipping = $objPurchase->getShippingTemp(); 
     127        // 決済モジュールを使用するかどうか 
     128        $this->use_module = $this->useModule($this->arrForm['payment_id']); 
    135129 
    136130        switch($this->getMode()) { 
     
    143137            break; 
    144138        case 'confirm': 
    145             // この時点で注文番号を確保しておく(クレジット、コンビニ決済で必要なため) 
    146             $arrData["order_id"] = $objQuery->nextval("dtb_order_order_id"); 
     139            /* 
     140             * 決済モジュールで必要なため, 受注番号を取得 
     141             */ 
     142            $this->arrForm["order_id"] = $objQuery->nextval("dtb_order_order_id"); 
    147143 
    148144            // 集計結果を受注一時テーブルに反映 
    149             $objPurchase->saveOrderTemp($uniqid, $arrData, $objCustomer); 
     145            $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, 
     146                                        $objCustomer); 
     147 
    150148            // 正常に登録されたことを記録しておく 
    151149            $objSiteSess->setRegistFlag(); 
    152150 
    153             // 決済方法により画面切替 
    154             if($payment_type != "") { 
    155                 $_SESSION["payment_id"] = $arrData['payment_id']; 
    156  
     151            // 決済モジュールを使用する場合 
     152            if ($this->use_module) { 
     153                $_SESSION["payment_id"] = $this->arrForm['payment_id']; 
    157154                $objPurchase->completeOrder(ORDER_PENDING); 
    158155                SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH); 
    159             }else{ 
    160                 // 受注を完了し, 購入完了ページへ 
     156            } 
     157            // 購入完了ページ 
     158            else { 
    161159                $objPurchase->completeOrder(ORDER_NEW); 
    162                 $objPurchase->sendOrderMail($arrData["order_id"]); 
     160                $objPurchase->sendOrderMail($this->arrForm["order_id"]); 
    163161                SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); 
    164162            } 
     
    168166            break; 
    169167        } 
    170         $this->arrData = $arrData; 
    171168    } 
    172169 
     
    179176        parent::destroy(); 
    180177    } 
     178 
     179    /** 
     180     * 決済モジュールを使用するかどうか. 
     181     * 
     182     * dtb_payment.memo03 に値が入っている場合は決済モジュールと見なす. 
     183     * 
     184     * @param integer $payment_id 支払い方法ID 
     185     * @return boolean 決済モジュールを使用する支払い方法の場合 true 
     186     */ 
     187    function useModule($payment_id) { 
     188        $objQuery =& SC_Query::getSingletonInstance(); 
     189        $memo03 = $objQuery->get('memo03', 'dtb_payment', 'payment_id = ?', 
     190                                 array($payment_id)); 
     191        return !SC_Utils_Ex::isBlank($memo03); 
     192    } 
    181193} 
    182194?> 
Note: See TracChangeset for help on using the changeset viewer.