Ignore:
Timestamp:
2010/08/06 14:52:59 (16 years ago)
Author:
eccuore
Message:

#792(ダウンロード販売機能) 機能追加

Location:
branches/version-2_5-dev/data/class/pages/shopping
Files:
4 edited

Legend:

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

    r18772 r18777  
    7777        $objCustomer = new SC_Customer(); 
    7878        $objCookie = new SC_Cookie(); 
     79        $objDb = new SC_Helper_DB_Ex(); 
    7980        $this->objFormParam = new SC_FormParam();            // フォーム用 
    8081        $this->lfInitParam();                                // パラメータ情報の初期化 
    … …  
    8586        $this->tpl_uniqid = $uniqid; 
    8687 
     88        //ダウンロード商品判定 
     89        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     90 
    8791        // ログインチェック 
    8892        if($objCustomer->isLoginSuccess()) { 
    89             // すでにログインされている場合は、お届け先設定画面に転送 
    90             $this->sendRedirect($this->getLocation("./deliv.php"), array()); 
     93            // すでにログインされている場合 
     94            if ($this->cartdown == 2) { 
     95                // 会員情報の住所を受注一時テーブルに書き込む 
     96                $objDb->sfRegistDelivData($uniqid, $objCustomer); 
     97                // 正常に登録されたことを記録しておく 
     98                $objSiteSess->setRegistFlag(); 
     99                //カート内が全てダウンロード商品の場合は支払方法設定画面に転送 
     100                $this->sendRedirect($this->getLocation("./payment.php"), array()); 
     101            } else { 
     102                // お届け先設定画面に転送 
     103                $this->sendRedirect($this->getLocation("./deliv.php"), array()); 
     104            } 
    91105            exit; 
    92106        } 
    … …  
    103117        case 'nonmember_confirm': 
    104118            $this->lfSetNonMember($this); 
     119            //非会員のダウンロード商品を含んだ買い物はNG 
     120            if($this->cartdown != 0){ 
     121                SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, "ダウンロード商品を含むお買い物は、会員登録が必要です。<br/>お手数ですが、会員登録をお願いします。"); 
     122            } 
    105123            // ※breakなし 
    106124        case 'confirm': 
    … …  
    133151        case 'nonmember': 
    134152            $this->lfSetNonMember($this); 
     153            //非会員のダウンロード商品を含んだ買い物はNG 
     154            if($this->cartdown != 0){ 
     155                SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, "ダウンロード商品を含むお買い物は、会員登録が必要です。<br/>お手数ですが、会員登録をお願いします。"); 
     156            } 
    135157            // ※breakなし 
    136158        default: 
    … …  
    198220        $this->objFormParam = new SC_FormParam();            // フォーム用 
    199221        $helperMobile = new SC_Helper_Mobile_Ex(); 
     222        $objDb = new SC_Helper_DB_Ex(); 
    200223        $this->lfInitParam();                                // パラメータ情報の初期化 
    201224        $this->objFormParam->setParam($_POST);            // POST値の取得 
    … …  
    206229        $this->tpl_uniqid = $uniqid; 
    207230 
     231        //ダウンロード商品判定 
     232        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     233 
    208234        // ログインチェック 
    209235        if($objCustomer->isLoginSuccess(true)) { 
    210             // すでにログインされている場合は、お届け先設定画面に転送 
    211             $this->sendRedirect($this->getLocation('./deliv.php'), true); 
     236            // すでにログインされている場合 
     237            if ($this->cartdown == 2) { 
     238                // 会員情報の住所を受注一時テーブルに書き込む 
     239                $objDb->sfRegistDelivData($uniqid, $objCustomer); 
     240                // 正常に登録されたことを記録しておく 
     241                $objSiteSess->setRegistFlag(); 
     242                //カート内が全てダウンロード商品の場合は支払方法設定画面に転送 
     243                $this->sendRedirect($this->getLocation("./payment.php"), array()); 
     244            } else { 
     245                // お届け先設定画面に転送 
     246                $this->sendRedirect($this->getLocation("./deliv.php"), array()); 
     247            } 
    212248            exit; 
    213249        } 
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php

    r18701 r18777  
    8080        $this->tpl_uniqid = $uniqid; 
    8181 
     82        //ダウンロード商品判定 
     83        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     84 
    8285        // カート集計処理 
    8386        $objDb->sfTotalCart($this, $objCartSess); 
    … …  
    194197        $this->tpl_uniqid = $uniqid; 
    195198 
     199        //ダウンロード商品判定 
     200        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     201 
    196202        // カート集計処理 
    197203        $objDb->sfTotalCart($this, $objCartSess); 
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php

    r18701 r18777  
    7474        $objCampaignSess = new SC_CampaignSession(); 
    7575        $objCustomer = new SC_Customer(); 
     76        $objDb = new SC_Helper_DB_Ex(); 
    7677        // クッキー管理クラス 
    7778        $objCookie = new SC_Cookie(COOKIE_EXPIRE); 
    … …  
    9394        $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); 
    9495        $this->tpl_uniqid = $uniqid; 
     96 
     97        //ダウンロード商品判定 
     98        $this->cartdown = $objDb->chkCartDown($objCartSess); 
    9599 
    96100        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
    … …  
    127131                        SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 
    128132                    } 
     133                } 
     134                //ダウンロード商品判定 
     135                if($this->cartdown==2){ 
     136                    // 会員情報の住所を受注一時テーブルに書き込む 
     137                    $objDb->sfRegistDelivData($uniqid, $objCustomer); 
     138                    // 正常に登録されたことを記録しておく 
     139                    $objSiteSess->setRegistFlag(); 
     140                    // ダウンロード商品有りの場合は、支払方法画面に転送 
     141                    $this->sendRedirect($this->getLocation("./payment.php"), array()); 
     142                    exit; 
    129143                } 
    130144            } else { 
    … …  
    239253        $objCartSess = new SC_CartSession(); 
    240254        $objCustomer = new SC_Customer(); 
     255        $objDb = new SC_Helper_DB_Ex(); 
    241256        // クッキー管理クラス 
    242257        $objCookie = new SC_Cookie(COOKIE_EXPIRE); 
    … …  
    258273        $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); 
    259274        $this->tpl_uniqid = $uniqid; 
     275 
     276        //ダウンロード商品判定 
     277        $this->cartdown = $objDb->chkCartDown($objCartSess); 
    260278 
    261279        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
    … …  
    293311                        SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 
    294312                    } 
     313                } 
     314                //ダウンロード商品判定 
     315                if($this->cartdown==2){ 
     316                    // 会員情報の住所を受注一時テーブルに書き込む 
     317                    $objDb->sfRegistDelivData($uniqid, $objCustomer); 
     318                    // 正常に登録されたことを記録しておく 
     319                    $objSiteSess->setRegistFlag(); 
     320                    // ダウンロード商品有りの場合は、支払方法画面に転送 
     321                    $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), array()); 
     322                    exit; 
    295323                } 
    296324            } else { 
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php

    r18701 r18777  
    8686        $this->tpl_uniqid = $uniqid; 
    8787 
     88        //ダウンロード商品判定 
     89        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     90 
    8891        // 会員ログインチェック 
    8992        if($this->objCustomer->isLoginSuccess()) { 
    … …  
    9194            $this->tpl_user_point = $this->objCustomer->getValue('point'); 
    9295            //戻り先URL 
    93             $this->tpl_back_url = URL_DELIV_TOP; 
     96            if ($this->cartdown == 2) { 
     97                // ダウンロード商品のみの場合はカート画面へ戻る 
     98                $this->tpl_back_url = URL_CART_TOP; 
     99            } else { 
     100                $this->tpl_back_url = URL_DELIV_TOP; 
     101            } 
    94102        } else { 
    95103            $this->tpl_back_url = URL_SHOP_TOP . "?from=nonmember"; 
    … …  
    203211        $this->tpl_uniqid = $uniqid; 
    204212 
     213        //ダウンロード商品判定 
     214        $this->cartdown = $objDb->chkCartDown($objCartSess); 
     215 
    205216        // 会員ログインチェック 
    206217        if($this->objCustomer->isLoginSuccess(true)) { 
    … …  
    236247                // 正常な推移であることを記録しておく 
    237248                $objSiteSess->setRegistFlag(); 
    238                 $this->sendRedirect(MOBILE_URL_SHOP_TOP, true); 
     249                if ($this->cartdown == 2) { 
     250                    // ダウンロード商品のみの場合はカート画面へ戻る 
     251                    $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); 
     252                } else { 
     253                    $this->sendRedirect(MOBILE_URL_SHOP_TOP, true); 
     254                } 
    239255                exit; 
    240256            } 
     257        } 
     258 
     259        // ダウンロード商品のみで、モードがお届け日時指定の場合はモードを変更 
     260        if ($this->cartdown == 2 && $_POST['mode'] == 'deliv_date') { 
     261            $_POST['mode'] = 'confirm'; 
    241262        } 
    242263 
    … …  
    341362        $objQuery = new SC_Query(); 
    342363        $objQuery->setOrder("rank DESC"); 
     364 
     365        //削除されていない支払方法を取得 
     366        $where = "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) "; 
     367        //ダウンロード商品の有無判定 
     368        if($this->cartdown != 0){ 
     369            //ダウンロード商品を含む場合は、クレジット決済以外は選択できない。 
     370            $where .= "AND payment_id =  " . CREDIT_PAYMENT; 
     371        } 
     372 
    343373        // 削除されていない支払方法を取得 
    344         $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) "); 
     374        $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", $where); 
     375 
    345376        // 配列初期化 
    346377        $data = array(); 
    347378        // 選択可能な支払方法を判定 
    348379        foreach($arrRet as $data) { 
     380            //ダウンロード販売に対する注意追加 
     381            if($this->cartdown != 0){ 
     382                $data['payment_method'] = $data['payment_method'] . "  (ダウンロード商品を含む場合、クレジット決済のみ選択可能です)"; 
     383            } 
    349384            // 下限と上限が設定されている 
    350385            if (strlen($data['rule']) != 0 && strlen($data['upper_rule']) != 0) { 
Note: See TracChangeset for help on using the changeset viewer.