source: branches/rel/html/frontparts/bloc/cart.php @ 12157

Revision 12157, 1.8 KB checked in by uehara, 14 years ago (diff)
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    // ¥«¡¼¥ÈÆâ¤Î¾¦ÉʣɣİìÍ÷¤ò¼èÆÀ
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.