source: branches/version-2_13_0/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviHeader.php @ 23126

Revision 23126, 3.2 KB checked in by m_uehara, 11 years ago (diff)

#2348 r23116 - r23125 をマージ

Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2013 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
24require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Login_Ex.php';
25
26/**
27 * ナビ(ヘッダブロック) のページクラス.
28 *
29 * @package Page
30 * @author LOCKON CO.,LTD.
31 * @version $Id$
32 */
33class LC_Page_FrontParts_Bloc_NaviHeader extends LC_Page_FrontParts_Bloc_Login_Ex
34{
35    /**
36     * Page を初期化する.
37     *
38     * @return void
39     */
40    public function init()
41    {
42        parent::init();
43        $masterData = new SC_DB_MasterData_Ex();
44        $this->arrProductType = $masterData->getMasterData('mtb_product_type'); //商品種類を取得
45    }
46
47    /**
48     * Page のプロセス.
49     *
50     * @return void
51     */
52    public function process()
53    {
54        $this->action();
55        $this->sendResponse();
56    }
57
58    /**
59     * Page のアクション.
60     *
61     * @return void
62     */
63    public function action()
64    {
65        parent::action();
66
67        //ヘッダーナビのカート情報を取得
68        $objCart = new SC_CartSession_Ex();
69        $cartKeys = $objCart->getKeys();
70        $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
71        $this->freeRule = $arrInfo['free_rule'];
72        $this->arrCartList = $this->lfGetCartData($objCart, $arrInfo, $cartKeys);
73    }
74
75    /**
76     * カートの情報を取得する
77     *
78     * @param  SC_CartSession $objCart  カートセッション管理クラス
79     * @param  Array          $arrInfo  基本情報配列
80     * @param  Array          $cartKeys 商品種類配列
81     * @return array          $arrCartList カートデータ配列
82     */
83    public function lfGetCartData($objCart, $arrInfo, $cartKeys)
84    {
85        $cartList = array();
86        foreach ($cartKeys as $key) {
87            // カート集計処理
88            $cartList[$key]['productTypeName'] = $this->arrProductType[$key]; //商品種類名
89            $cartList[$key]['totalInctax'] = $objCart->getAllProductsTotal($key); //合計金額
90            $cartList[$key]['delivFree'] = $arrInfo['free_rule'] - $cartList[$key]['totalInctax']; // 送料無料までの金額を計算
91            $cartList[$key]['totalTax'] = $objCart->getAllProductsTax($key); //消費税合計
92            $cartList[$key]['quantity'] = $objCart->getTotalQuantity($key); //商品数量合計
93            $cartList[$key]['productTypeId'] = $key; // 商品種別ID
94        }
95
96        return $cartList;
97    }
98}
Note: See TracBrowser for help on using the repository browser.