Changeset 16130 for branches/feature-module-update/html
- Timestamp:
- 2007/09/28 03:40:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/html/mobile/cart/index.php
r15532 r16130 1 1 <?php 2 2 /** 3 * 3 * 4 4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 5 5 * 6 6 * http://www.lockon.co.jp/ 7 * 7 * 8 * 9 * モバイルサイト/XXX 8 10 */ 11 12 // {{{ requires 9 13 require_once("../require.php"); 14 require_once(CLASS_PATH . "page_extends/cart/LC_Page_Cart_Ex.php"); 10 15 11 class LC_Page { 12 var $arrSession; 13 var $arrProductsClass; 14 var $tpl_total_pretax; 15 var $tpl_total_tax; 16 var $tpl_total_point; 17 var $tpl_message; 18 function LC_Page() { 19 /** 必ず指定する **/ 20 $this->tpl_css = '/css/layout/cartin/index.css'; // メインCSSパス 21 /** 必ず指定する **/ 22 $this->tpl_mainpage = 'cart/index.tpl'; // メインテンプレート 23 $this->tpl_title = "カゴの中を見る"; 24 } 25 } 16 // }}} 17 // {{{ generate page 26 18 27 // 買い物を続ける場合 28 if($_REQUEST['continue']) { 29 header("Location: " . gfAddSessionId(MOBILE_URL_SITE_TOP) ); 30 exit; 31 } 32 33 $objPage = new LC_Page(); 34 $objView = new SC_MobileView(false); 35 $objCartSess = new SC_CartSession("", false); 36 $objSiteSess = new SC_SiteSession(); 37 $objSiteInfo = $objView->objSiteInfo; 38 $objCustomer = new SC_Customer(); 39 // 基本情報の取得 40 $arrInfo = $objSiteInfo->data; 41 42 // 商品購入中にカート内容が変更された。 43 if($objCartSess->getCancelPurchase()) { 44 $objPage->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。"; 45 } 46 47 switch($_POST['mode']) { 48 case 'confirm': 49 // カート内情報の取得 50 $arrRet = $objCartSess->getCartList(); 51 $max = count($arrRet); 52 $cnt = 0; 53 for ($i = 0; $i < $max; $i++) { 54 // 商品規格情報の取得 55 $arrData = sfGetProductsClass($arrRet[$i]['id']); 56 // DBに存在する商品 57 if($arrData != "") { 58 $cnt++; 59 } 60 } 61 // カート商品が1件以上存在する場合 62 if($cnt > 0) { 63 // 正常に登録されたことを記録しておく 64 $objSiteSess->setRegistFlag(); 65 $pre_uniqid = $objSiteSess->getUniqId(); 66 // 注文一時IDの発行 67 $objSiteSess->setUniqId(); 68 $uniqid = $objSiteSess->getUniqId(); 69 // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ 70 if($pre_uniqid != "") { 71 $sqlval['order_temp_id'] = $uniqid; 72 $where = "order_temp_id = ?"; 73 $objQuery = new SC_Query(); 74 $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid)); 75 } 76 // カートを購入モードに設定 77 $objCartSess->saveCurrentCart($uniqid); 78 // 購入ページへ 79 header("Location: " . gfAddSessionId(MOBILE_URL_SHOP_TOP)); 80 exit; 81 } 82 break; 83 default: 84 break; 85 } 86 87 switch($_GET['mode']) { 88 case 'up': 89 $objCartSess->upQuantity($_GET['cart_no']); 90 sfReload(session_name() . '=' . session_id()); 91 break; 92 case 'down': 93 $objCartSess->downQuantity($_GET['cart_no']); 94 sfReload(session_name() . '=' . session_id()); 95 break; 96 case 'delete': 97 $objCartSess->delProduct($_GET['cart_no']); 98 sfReload(session_name() . '=' . session_id()); 99 break; 100 } 101 102 // カート集計処理 103 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 104 $objPage->arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer); 105 106 $objPage->arrInfo = $arrInfo; 107 108 // ログイン判定 109 if($objCustomer->isLoginSuccess()) { 110 $objPage->tpl_login = true; 111 $objPage->tpl_user_point = $objCustomer->getValue('point'); 112 $objPage->tpl_name = $objCustomer->getValue('name01'); 113 } 114 115 // 送料無料までの金額を計算 116 $tpl_deliv_free = $objPage->arrInfo['free_rule'] - $objPage->tpl_total_pretax; 117 $objPage->tpl_deliv_free = $tpl_deliv_free; 118 119 // 前頁のURLを取得 120 $objPage->tpl_prev_url = $objCartSess->getPrevURL(); 121 122 $objView->assignobj($objPage); 123 $objView->display(SITE_FRAME); 124 //-------------------------------------------------------------------------------------------------------------------------- 19 $objPage = new LC_Page_Cart_Ex(); 20 $objPage->mobileInit(); 21 $objPage->mobileProcess(); 22 register_shutdown_function(array($objPage, "destroy")); 125 23 ?>
Note: See TracChangeset
for help on using the changeset viewer.