Changeset 16130 for branches/feature-module-update/data/class
- Timestamp:
- 2007/09/28 03:40:13 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/pages/cart/LC_Page_Cart.php
r16060 r16130 144 144 145 145 /** 146 * モバイルページを初期化する. 147 * 148 * @return void 149 */ 150 function mobileInit() { 151 $this->init(); 152 } 153 154 /** 155 * Page のプロセス(モバイル). 156 * 157 * @return void 158 */ 159 function mobileProcess() { 160 161 // 買い物を続ける場合 162 if($_REQUEST['continue']) { 163 $this->sendRedirect(MOBILE_URL_SITE_TOP, 164 SC_Helper_Mobile_Ex::sessionIdArray()); 165 exit; 166 } 167 168 $objView = new SC_MobileView(false); 169 $objCartSess = new SC_CartSession("", false); 170 $objSiteSess = new SC_SiteSession(); 171 $objSiteInfo = $objView->objSiteInfo; 172 $objCustomer = new SC_Customer(); 173 $objDb = new SC_Helper_DB_Ex(); 174 175 // 基本情報の取得 176 $arrInfo = $objSiteInfo->data; 177 178 // 商品購入中にカート内容が変更された。 179 if($objCartSess->getCancelPurchase()) { 180 $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。"; 181 } 182 183 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 184 185 switch($_POST['mode']) { 186 case 'confirm': 187 // カート内情報の取得 188 $arrRet = $objCartSess->getCartList(); 189 $max = count($arrRet); 190 $cnt = 0; 191 for ($i = 0; $i < $max; $i++) { 192 // 商品規格情報の取得 193 $arrData = $objDb->sfGetProductsClass($arrRet[$i]['id']); 194 // DBに存在する商品 195 if($arrData != "") { 196 $cnt++; 197 } 198 } 199 // カート商品が1件以上存在する場合 200 if($cnt > 0) { 201 // 正常に登録されたことを記録しておく 202 $objSiteSess->setRegistFlag(); 203 $pre_uniqid = $objSiteSess->getUniqId(); 204 // 注文一時IDの発行 205 $objSiteSess->setUniqId(); 206 $uniqid = $objSiteSess->getUniqId(); 207 // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ 208 if($pre_uniqid != "") { 209 $sqlval['order_temp_id'] = $uniqid; 210 $where = "order_temp_id = ?"; 211 $objQuery = new SC_Query(); 212 $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid)); 213 } 214 // カートを購入モードに設定 215 $objCartSess->saveCurrentCart($uniqid); 216 // 購入ページへ 217 $this->sendRedirect(MOBILE_URL_SHOP_TOP, 218 SC_Helper_Mobile_Ex::sessionIdArray()); 219 exit; 220 } 221 break; 222 default: 223 break; 224 } 225 226 if (!isset($_GET['mode'])) $_GET['mode'] = ""; 227 228 switch($_GET['mode']) { 229 case 'up': 230 $objCartSess->upQuantity($_GET['cart_no']); 231 $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 232 break; 233 case 'down': 234 $objCartSess->downQuantity($_GET['cart_no']); 235 $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 236 break; 237 case 'delete': 238 $objCartSess->delProduct($_GET['cart_no']); 239 $this->reload(SC_Helper_Mobile_Ex::sessionIdArray()); 240 break; 241 } 242 243 // カート集計処理 244 $this = $objDb->sfTotalCart($this, $objCartSess, $arrInfo); 245 $this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo, $objCustomer); 246 247 $this->arrInfo = $arrInfo; 248 249 // ログイン判定 250 if($objCustomer->isLoginSuccess()) { 251 $this->tpl_login = true; 252 $this->tpl_user_point = $objCustomer->getValue('point'); 253 $this->tpl_name = $objCustomer->getValue('name01'); 254 } 255 256 // 送料無料までの金額を計算 257 $tpl_deliv_free = $this->arrInfo['free_rule'] - $this->tpl_total_pretax; 258 $this->tpl_deliv_free = $tpl_deliv_free; 259 260 // 前頁のURLを取得 261 $this->tpl_prev_url = $objCartSess->getPrevURL(); 262 263 $objView->assignobj($this); 264 $objView->display(SITE_FRAME); 265 } 266 267 /** 146 268 * デストラクタ. 147 269 *
Note: See TracChangeset
for help on using the changeset viewer.
