source: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php @ 19860

Revision 19860, 3.2 KB checked in by nanasess, 13 years ago (diff)

#843(複数配送先の指定)

  • とりあえず通常配送が通るように修正
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once(CLASS_REALDIR . "pages/LC_Page.php");
26
27/**
28 * お届け先の複数指定 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Shopping_Multiple extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $masterData = new SC_DB_MasterData();
47        $this->arrPref = $masterData->getMasterData('mtb_pref');
48        $this->tpl_title = "お届け先の複数指定";
49        $this->httpCacheControl('nocache');
50    }
51
52    /**
53     * Page のプロセス.
54     *
55     * @return void
56     */
57    function process() {
58        $this->action();
59        $this->sendResponse();
60    }
61
62    /**
63     * Page のプロセス.
64     *
65     * @return void
66     */
67    function action() {
68        $objSiteSess = new SC_SiteSession();
69        $objCartSess = new SC_CartSession();
70        $this->objCustomer = new SC_Customer();
71
72        $this->addrs = $this->getDelivAddrs();
73        $this->cartKey = $_SESSION['cartKey'];
74        $cartLists =& $objCartSess->getCartList($this->cartKey);
75        foreach (array_keys($cartLists) as $key) {
76            for ($i = 0; $i < $cartLists[$key]['quantity']; $i++) {
77                $this->items[] =& $cartLists[$key]['productsClass'];
78            }
79        }
80
81    }
82
83    /**
84     * デストラクタ.
85     *
86     * @return void
87     */
88    function destroy() {
89        parent::destroy();
90    }
91
92    /**
93     * 配送住所のプルダウン用連想配列を取得する.
94     *
95     * 会員ログイン済みの場合は, 会員登録住所及び追加登録住所を取得する.
96     * 非会員の場合は, 「お届け先の指定」画面で入力した住所を取得する.
97     */
98    function getDelivAddrs() {
99        if ($this->objCustomer->isLoginSuccess()) {
100            $addrs = $this->objCustomer->getCustomerAddress($_SESSION['customer']['customer_id']);
101        } else {
102            // TODO
103            $addrs = array();
104        }
105        $results = array();
106        foreach ($addrs as $key => $val) {
107            $other_deliv_id = SC_Utils_Ex::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id'];
108            $results[$other_deliv_id] = $val['name01'] . $val['name02']
109                . " " . $this->arrPref[$val['pref']] . $val['addr01'] . $val['addr02'];
110        }
111        return $results;
112    }
113}
114?>
Note: See TracBrowser for help on using the repository browser.