source: branches/feature-module-update/html/frontparts/bloc/cart.php @ 15080

Revision 15080, 1.9 KB checked in by nanasess, 17 years ago (diff)

svn properties 設定

  • svn:mime-type - application/x-httpd-php; charset=UTF-8
  • svn:keywords - Id
  • Property svn:keywords set to Id
  • Property svn:mime-type set to application/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7class LC_CartPage {
8    function LC_CartPage() {
9        /** 必ず変更する **/
10        $this->tpl_mainpage = BLOC_PATH . 'cart.tpl';   // メイン
11    }
12}
13
14$objSubPage = new LC_CartPage();
15$objSubView = new SC_SiteView();
16$objCart = new SC_CartSession();
17$objSiteInfo = new SC_SiteInfo;
18
19if (count($_SESSION[$objCart->key]) > 0){
20    // カート情報を取得
21    $arrCartList = $objCart->getCartList();
22   
23    // カート内の商品ID一覧を取得
24    $arrAllProductID = $objCart->getAllProductID();
25    // 商品が1つ以上入っている場合には商品名称を取得
26    if (count($arrAllProductID) > 0){
27        $objQuery = new SC_Query();
28        $arrVal = array();
29        $sql = "";
30        $sql = "SELECT name FROM dtb_products WHERE product_id IN ( ?";
31        $arrVal = array($arrAllProductID[0]);
32        for($i = 1 ; $i < count($arrAllProductID) ; $i++){
33            $sql.= " ,? ";
34            array_push($arrVal, $arrAllProductID[$i]);
35        }
36        $sql.= " )";
37       
38        $arrProduct_name = $objQuery->getAll($sql, $arrVal);
39       
40        foreach($arrProduct_name as $key => $val){
41            $arrCartList[$key]['product_name'] = $val['name'];
42        }
43    }
44    // 店舗情報の取得
45    $arrInfo = $objSiteInfo->data;
46    // 購入金額合計
47    $ProductsTotal = $objCart->getAllProductsTotal($arrInfo);
48   
49    // 合計個数
50    $TotalQuantity = $objCart->getTotalQuantity();
51   
52    // 送料無料までの金額
53    $arrCartList[0]['ProductsTotal'] = $ProductsTotal;
54    $arrCartList[0]['TotalQuantity'] = $TotalQuantity;
55    $deliv_free = $arrInfo['free_rule'] - $ProductsTotal;
56    $arrCartList[0]['free_rule'] = $arrInfo['free_rule'];
57    $arrCartList[0]['deliv_free'] = $deliv_free;
58   
59    $objSubPage->arrCartList = $arrCartList;
60}
61
62$objSubView->assignobj($objSubPage);
63$objSubView->display($objSubPage->tpl_mainpage);
64//-----------------------------------------------------------------------------------------------------------------------------------
65
66?>
Note: See TracBrowser for help on using the repository browser.