Changeset 16130


Ignore:
Timestamp:
2007/09/28 03:40:13 (17 years ago)
Author:
nanasess
Message:

モバイルページ追加

Location:
branches/feature-module-update
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/cart/LC_Page_Cart.php

    r16060 r16130  
    144144 
    145145    /** 
     146     * モバイルページを初期化する. 
     147     * 
     148     * @return void 
     149     */ 
     150    function mobileInit() { 
     151        $this->init(); 
     152    } 
     153 
     154    /** 
     155     * Page のプロセス(モバイル). 
     156     * 
     157     * @return void 
     158     */ 
     159    function mobileProcess() { 
     160 
     161        // 買い物を続ける場合 
     162        if($_REQUEST['continue']) { 
     163            $this->sendRedirect(MOBILE_URL_SITE_TOP, 
     164                                SC_Helper_Mobile_Ex::sessionIdArray()); 
     165            exit; 
     166        } 
     167 
     168        $objView = new SC_MobileView(false); 
     169        $objCartSess = new SC_CartSession("", false); 
     170        $objSiteSess = new SC_SiteSession(); 
     171        $objSiteInfo = $objView->objSiteInfo; 
     172        $objCustomer = new SC_Customer(); 
     173        $objDb = new SC_Helper_DB_Ex(); 
     174 
     175        // 基本情報の取得 
     176        $arrInfo = $objSiteInfo->data; 
     177 
     178        // 商品購入中にカート内容が変更された。 
     179        if($objCartSess->getCancelPurchase()) { 
     180            $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。"; 
     181        } 
     182 
     183        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
     184 
     185        switch($_POST['mode']) { 
     186        case 'confirm': 
     187            // カート内情報の取得 
     188            $arrRet = $objCartSess->getCartList(); 
     189            $max = count($arrRet); 
     190            $cnt = 0; 
     191            for ($i = 0; $i < $max; $i++) { 
     192                // 商品規格情報の取得 
     193                $arrData = $objDb->sfGetProductsClass($arrRet[$i]['id']); 
     194                // DBに存在する商品 
     195                if($arrData != "") { 
     196                    $cnt++; 
     197                } 
     198            } 
     199            // カート商品が1件以上存在する場合 
     200            if($cnt > 0) { 
     201                // 正常に登録されたことを記録しておく 
     202                $objSiteSess->setRegistFlag(); 
     203                $pre_uniqid = $objSiteSess->getUniqId(); 
     204                // 注文一時IDの発行 
     205                $objSiteSess->setUniqId(); 
     206                $uniqid = $objSiteSess->getUniqId(); 
     207                // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ 
     208                if($pre_uniqid != "") { 
     209                    $sqlval['order_temp_id'] = $uniqid; 
     210                    $where = "order_temp_id = ?"; 
     211                    $objQuery = new SC_Query(); 
     212                    $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid)); 
     213                } 
     214                // カートを購入モードに設定 
     215                $objCartSess->saveCurrentCart($uniqid); 
     216                // 購入ページへ 
     217                $this->sendRedirect(MOBILE_URL_SHOP_TOP, 
     218                                    SC_Helper_Mobile_Ex::sessionIdArray()); 
     219                exit; 
     220            } 
     221            break; 
     222        default: 
     223            break; 
     224        } 
     225 
     226        if (!isset($_GET['mode'])) $_GET['mode'] = ""; 
     227 
     228        switch($_GET['mode']) { 
     229        case 'up': 
     230            $objCartSess->upQuantity($_GET['cart_no']); 
     231            $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 
     232            break; 
     233        case 'down': 
     234            $objCartSess->downQuantity($_GET['cart_no']); 
     235            $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 
     236            break; 
     237        case 'delete': 
     238            $objCartSess->delProduct($_GET['cart_no']); 
     239            $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 
     240            break; 
     241        } 
     242 
     243        // カート集計処理 
     244        $this = $objDb->sfTotalCart($this, $objCartSess, $arrInfo); 
     245        $this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo, $objCustomer); 
     246 
     247        $this->arrInfo = $arrInfo; 
     248 
     249        // ログイン判定 
     250        if($objCustomer->isLoginSuccess()) { 
     251            $this->tpl_login = true; 
     252            $this->tpl_user_point = $objCustomer->getValue('point'); 
     253            $this->tpl_name = $objCustomer->getValue('name01'); 
     254        } 
     255 
     256        // 送料無料までの金額を計算 
     257        $tpl_deliv_free = $this->arrInfo['free_rule'] - $this->tpl_total_pretax; 
     258        $this->tpl_deliv_free = $tpl_deliv_free; 
     259 
     260        // 前頁のURLを取得 
     261        $this->tpl_prev_url = $objCartSess->getPrevURL(); 
     262 
     263        $objView->assignobj($this); 
     264        $objView->display(SITE_FRAME); 
     265    } 
     266 
     267    /** 
    146268     * デストラクタ. 
    147269     * 
  • branches/feature-module-update/html/mobile/cart/index.php

    r15532 r16130  
    11<?php 
    22/** 
    3  *  
     3 * 
    44 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 
    55 * 
    66 * http://www.lockon.co.jp/ 
    7  *  
     7 * 
     8 * 
     9 * モバイルサイト/XXX 
    810 */ 
     11 
     12// {{{ requires 
    913require_once("../require.php"); 
     14require_once(CLASS_PATH . "page_extends/cart/LC_Page_Cart_Ex.php"); 
    1015 
    11 class LC_Page { 
    12     var $arrSession; 
    13     var $arrProductsClass; 
    14     var $tpl_total_pretax; 
    15     var $tpl_total_tax; 
    16     var $tpl_total_point; 
    17     var $tpl_message; 
    18     function LC_Page() { 
    19         /** 必ず指定する **/ 
    20         $this->tpl_css = '/css/layout/cartin/index.css';    // メインCSSパス 
    21         /** 必ず指定する **/ 
    22         $this->tpl_mainpage = 'cart/index.tpl';     // メインテンプレート 
    23         $this->tpl_title = "カゴの中を見る"; 
    24     } 
    25 } 
     16// }}} 
     17// {{{ generate page 
    2618 
    27 // 買い物を続ける場合 
    28 if($_REQUEST['continue']) { 
    29     header("Location: " . gfAddSessionId(MOBILE_URL_SITE_TOP) ); 
    30     exit; 
    31 } 
    32  
    33 $objPage = new LC_Page(); 
    34 $objView = new SC_MobileView(false); 
    35 $objCartSess = new SC_CartSession("", false); 
    36 $objSiteSess = new SC_SiteSession(); 
    37 $objSiteInfo = $objView->objSiteInfo; 
    38 $objCustomer = new SC_Customer(); 
    39 // 基本情報の取得 
    40 $arrInfo = $objSiteInfo->data; 
    41  
    42 // 商品購入中にカート内容が変更された。 
    43 if($objCartSess->getCancelPurchase()) { 
    44     $objPage->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。"; 
    45 } 
    46  
    47 switch($_POST['mode']) { 
    48 case 'confirm': 
    49     // カート内情報の取得 
    50     $arrRet = $objCartSess->getCartList(); 
    51     $max = count($arrRet); 
    52     $cnt = 0; 
    53     for ($i = 0; $i < $max; $i++) { 
    54         // 商品規格情報の取得 
    55         $arrData = sfGetProductsClass($arrRet[$i]['id']); 
    56         // DBに存在する商品 
    57         if($arrData != "") { 
    58             $cnt++; 
    59         } 
    60     } 
    61     // カート商品が1件以上存在する場合 
    62     if($cnt > 0) { 
    63         // 正常に登録されたことを記録しておく 
    64         $objSiteSess->setRegistFlag(); 
    65         $pre_uniqid = $objSiteSess->getUniqId(); 
    66         // 注文一時IDの発行 
    67         $objSiteSess->setUniqId(); 
    68         $uniqid = $objSiteSess->getUniqId(); 
    69         // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ 
    70         if($pre_uniqid != "") { 
    71             $sqlval['order_temp_id'] = $uniqid; 
    72             $where = "order_temp_id = ?"; 
    73             $objQuery = new SC_Query(); 
    74             $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid)); 
    75         } 
    76         // カートを購入モードに設定 
    77         $objCartSess->saveCurrentCart($uniqid); 
    78         // 購入ページへ 
    79         header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_TOP)); 
    80         exit; 
    81     } 
    82     break; 
    83 default: 
    84     break; 
    85 } 
    86  
    87 switch($_GET['mode']) { 
    88 case 'up': 
    89     $objCartSess->upQuantity($_GET['cart_no']); 
    90     sfReload(session_name() . '=' . session_id()); 
    91     break; 
    92 case 'down': 
    93     $objCartSess->downQuantity($_GET['cart_no']); 
    94     sfReload(session_name() . '=' . session_id()); 
    95     break; 
    96 case 'delete': 
    97     $objCartSess->delProduct($_GET['cart_no']); 
    98     sfReload(session_name() . '=' . session_id()); 
    99     break; 
    100 } 
    101  
    102 // カート集計処理 
    103 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 
    104 $objPage->arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer); 
    105  
    106 $objPage->arrInfo = $arrInfo; 
    107  
    108 // ログイン判定 
    109 if($objCustomer->isLoginSuccess()) { 
    110     $objPage->tpl_login = true; 
    111     $objPage->tpl_user_point = $objCustomer->getValue('point'); 
    112     $objPage->tpl_name = $objCustomer->getValue('name01'); 
    113 } 
    114  
    115 // 送料無料までの金額を計算 
    116 $tpl_deliv_free = $objPage->arrInfo['free_rule'] - $objPage->tpl_total_pretax; 
    117 $objPage->tpl_deliv_free = $tpl_deliv_free; 
    118  
    119 // 前頁のURLを取得 
    120 $objPage->tpl_prev_url = $objCartSess->getPrevURL(); 
    121  
    122 $objView->assignobj($objPage); 
    123 $objView->display(SITE_FRAME); 
    124 //-------------------------------------------------------------------------------------------------------------------------- 
     19$objPage = new LC_Page_Cart_Ex(); 
     20$objPage->mobileInit(); 
     21$objPage->mobileProcess(); 
     22register_shutdown_function(array($objPage, "destroy")); 
    12523?> 
Note: See TracChangeset for help on using the changeset viewer.