Changeset 19845 for branches/version-2_5-dev/data
- Timestamp:
- 2011/01/06 22:32:15 (13 years ago)
- Location:
- branches/version-2_5-dev/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/mobile/cart/index.tpl
r19835 r19845 28 28 <!--{$tpl_message}--><br> 29 29 <!--{/if}--> 30 <!--{if count($arrProductsClass) > 0}--> 31 <form name="form1" id="form1" method="post" action="?" utn> 30 <!--{if count($cartItems) > 0}--> 31 <!--{foreach from=$cartKeys item=key}--> 32 <form name="form<!--{$key}-->" id="form<!--{$key}-->" method="post" action="?" utn> 32 33 <input type="hidden" name="mode" value="confirm"> 33 34 <input type="hidden" name="cart_no" value=""> 35 <input type="hidden" name="cartKey" value="<!--{$key}-->"> 34 36 <!--ご注文内容ここから--> 35 37 <hr> 36 <!--{section name=cnt loop=$arrProductsClass}--> 37 <!--{* 商品名 *}--><!--{$arrProductsClass[cnt].name|h}--><br> 38 <!--{foreach from=$cartItems[$key] item=item}--> 39 <!--{* 商品名 *}--><!--{$item.productsClass.name|h}--><br> 40 <!--{* 規格名1 *}--><!--{if $item.productsClass.classcategory_name1 != ""}--><!--{$item.productsClass.class_name1}-->:<!--{$item.productsClass.classcategory_name1}--><br><!--{/if}--> 41 <!--{* 規格名2 *}--><!--{if $item.productsClass.classcategory_name2 != ""}--><!--{$item.productsClass.class_name2}-->:<!--{$item.productsClass.classcategory_name2}--><br><!--{/if}--> 38 42 <!--{* 販売価格 *}--> 39 \<!--{$arrProductsClass[cnt].price02|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> 40 × <!--{$arrProductsClass[cnt].quantity}--><br> 41 <!--{* 詳細 *}--> 42 <!--{if $arrProductsClass[cnt].classcategory_name1 != ""}--> 43 <!--{$arrProductsClass[cnt].class_name1}-->:<!--{$arrProductsClass[cnt].classcategory_name1}--><br> 44 <!--{/if}--> 45 <!--{if $arrProductsClass[cnt].classcategory_name2 != ""}--> 46 <!--{$arrProductsClass[cnt].class_name2}-->:<!--{$arrProductsClass[cnt].classcategory_name2}--><br> 47 <!--{/if}--> 43 ¥<!--{$item.productsClass.price02|sfCalcIncTax:$arrInfo.tax:$arrInfo.tax_rule|number_format}--> 44 × <!--{$item.quantity}--><br> 48 45 <br> 49 46 <!--{* 数量 *}--> 50 数量:<!--{$ arrProductsClass[cnt].quantity}-->51 <a href="?mode=up&cart_no=<!--{$ arrProductsClass[cnt].cart_no}-->">+</a>52 <a href="?mode=down&cart_no=<!--{$ arrProductsClass[cnt].cart_no}-->">-</a>53 <a href="?mode=delete&cart_no=<!--{$ arrProductsClass[cnt].cart_no}-->">削除</a><br>47 数量:<!--{$item.quantity}--> 48 <a href="?mode=up&cart_no=<!--{$item.cart_no}-->&cartKey=<!--{$key}-->">+</a> 49 <a href="?mode=down&cart_no=<!--{$item.cart_no}-->&cartKey=<!--{$key}-->">-</a> 50 <a href="?mode=delete&cart_no=<!--{$item.cart_no}-->&cartKey=<!--{$key}-->">削除</a><br> 54 51 <!--{* 合計 *}--> 55 小計:<!--{$ arrProductsClass[cnt].total_inctax|number_format}-->円<br>56 <div align="right"><a href="<!--{$smarty.const.MOBILE_P_DETAIL_URL_PATH}--><!--{$ arrProductsClass[cnt].product_id|u}-->">商品詳細へ→</a></div>52 小計:<!--{$item.total_inctax|number_format}-->円<br> 53 <div align="right"><a href="<!--{$smarty.const.MOBILE_P_DETAIL_URL_PATH}--><!--{$item.productsClass.product_id|u}-->">商品詳細へ→</a></div> 57 54 <HR> 58 <!--{/section}--> 59 商品合計:<!--{$tpl_total_inctax|number_format}-->円<br> 60 合計:<!--{$arrData.total-$arrData.deliv_fee|number_format}-->円<br> 61 <!--{if $arrData.birth_point > 0}--> 55 <!--{/foreach}--> 56 商品合計:<!--{$tpl_total_inctax[$key]|number_format}-->円<br> 57 合計:<!--{$arrData[$key].total-$arrData[$key].deliv_fee|number_format}-->円<br> 58 <!--{if $smarty.const.USE_POINT !== false}--> 59 <br> 60 <!--{if $arrData[$key].birth_point > 0}--> 62 61 お誕生月ポイント<br> 63 <!--{$arrData.birth_point|number_format}-->pt<br> 62 <!--{$arrData[$key].birth_point|number_format}-->pt<br> 63 <!--{/if}--> 64 今回加算ポイント<br> 65 <!--{$arrData[$key].add_point|number_format}-->pt<br> 64 66 <!--{/if}--> 65 67 <br> 66 68 <center><input type="submit" value="注文する"></center> 67 69 </form> 68 < form method="post" action="?">69 <input type="hidden" name="mode" value="continue">70 <center><input type="submit" value="お買物を続ける"></center>71 < /form>70 <!--{/foreach}--> 71 <!--{if $tpl_prev_url != ""}--> 72 <a href="<!--{$tpl_prev_url}-->">[emoji:69]お買物を続ける</a> 73 <!--{/if}--> 72 74 <!--{else}--> 73 75 ※現在カート内に商品はございません。<br> -
branches/version-2_5-dev/data/class/pages/cart/LC_Page_Cart.php
r19833 r19845 33 33 * @package Page 34 34 * @author LOCKON CO.,LTD. 35 * @version $Id :LC_Page_Cart.php 15532 2007-08-31 14:39:46Z nanasess$35 * @version $Id$ 36 36 */ 37 37 class LC_Page_Cart extends LC_Page { … … 86 86 $objSiteInfo = $objView->objSiteInfo; 87 87 $objCustomer = new SC_Customer(); 88 $objDb = new SC_Helper_DB_Ex(); 89 $objProduct = new SC_Product(); 90 91 $i = 0; 88 92 89 $this->cartKeys = $objCartSess->getKeys(); 93 90 foreach ($this->cartKeys as $key) { … … 102 99 103 100 switch($_POST['mode']) { 104 case 'up':105 $objCartSess->upQuantity($_POST['cart_no'], $_POST['cartKey']);106 $this->objDisplay->reload(); // PRG pattern107 break;108 case 'down':109 $objCartSess->downQuantity($_POST['cart_no'], $_POST['cartKey']);110 $this->objDisplay->reload(); // PRG pattern111 break;112 case 'delete':113 $objCartSess->delProduct($_POST['cart_no'], $_POST['cartKey']);114 $this->objDisplay->reload(); // PRG pattern115 break;116 101 case 'confirm': 117 102 // カート内情報の取得 … … 144 129 } 145 130 131 // 商品の個数変更、削除処理 132 $changeCartMode = (Net_UserAgent_Mobile::isMobile() === true) ? $_GET['mode'] : $_POST['mode']; 133 /* 134 * FIXME モバイルの場合 sfReload() ではなく sendRedirect() を使った方が良いが無限ループしてしまう... 135 */ 136 switch($changeCartMode) { 137 case 'up': 138 if(Net_UserAgent_Mobile::isMobile() === true) { 139 $objCartSess->upQuantity($_GET['cart_no'], $_GET['cartKey']); 140 SC_Utils_Ex::sfReload(session_name() . "=" . session_id()); 141 } else { 142 $objCartSess->upQuantity($_POST['cart_no'], $_POST['cartKey']); 143 $this->objDisplay->reload(); // PRG pattern 144 } 145 break; 146 case 'down': 147 if(Net_UserAgent_Mobile::isMobile() === true) { 148 $objCartSess->downQuantity($_GET['cart_no'], $_GET['cartKey']); 149 SC_Utils_Ex::sfReload(session_name() . "=" . session_id()); 150 } else { 151 $objCartSess->downQuantity($_POST['cart_no'], $_POST['cartKey']); 152 $this->objDisplay->reload(); // PRG pattern 153 } 154 break; 155 case 'delete': 156 if(Net_UserAgent_Mobile::isMobile() === true) { 157 $objCartSess->delProduct($_GET['cart_no'], $_GET['cartKey']); 158 SC_Utils_Ex::sfReload(session_name() . "=" . session_id()); 159 } else { 160 $objCartSess->delProduct($_POST['cart_no'], $_POST['cartKey']); 161 $this->objDisplay->reload(); // PRG pattern 162 } 163 break; 164 default: 165 break; 166 } 167 146 168 // 基本情報の取得 147 169 $this->arrInfo = $objSiteInfo->data; … … 160 182 161 183 // ログイン判定 162 if($objCustomer->isLoginSuccess()) {163 $this->tpl_login = true;164 $this->tpl_user_point = $objCustomer->getValue('point');165 $this->tpl_name = $objCustomer->getValue('name01');166 }167 168 // 前頁のURLを取得169 $this->tpl_prev_url = $objCartSess->getPrevURL();170 }171 172 /**173 * モバイルページを初期化する.174 *175 * @return void176 */177 function mobileInit() {178 $this->init();179 }180 181 /**182 * Page のプロセス(モバイル).183 *184 * @return void185 */186 function mobileProcess() {187 parent::mobileProcess();188 $this->mobileAction();189 $this->sendResponse();190 }191 192 /**193 * Page のアクション(モバイル).194 *195 * @return void196 */197 function mobileAction() {198 // 買い物を続ける場合199 if ($_REQUEST['mode'] == 'continue') {200 $this->objDisplay->redirect($this->getLocation(MOBILE_TOP_URL_PATH));201 exit;202 }203 204 $objView = new SC_MobileView(false);205 $objCartSess = new SC_CartSession();206 $objSiteSess = new SC_SiteSession();207 $objSiteInfo = $objView->objSiteInfo;208 $objCustomer = new SC_Customer();209 $objDb = new SC_Helper_DB_Ex();210 211 // 商品購入中にカート内容が変更された。212 if($objCartSess->getCancelPurchase()) {213 $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";214 }215 216 switch($_POST['mode']) {217 case 'confirm':218 // カート内情報の取得219 $arrRet = $objCartSess->getCartList();220 $max = count($arrRet);221 $cnt = 0;222 for ($i = 0; $i < $max; $i++) {223 // 商品規格情報の取得224 $arrData = $objDb->sfGetProductsClass($arrRet[$i]['id']);225 // DBに存在する商品226 if($arrData != "") {227 $cnt++;228 }229 }230 // カート商品が1件以上存在する場合231 if($cnt > 0) {232 // 正常に登録されたことを記録しておく233 $objSiteSess->setRegistFlag();234 $pre_uniqid = $objSiteSess->getUniqId();235 // 注文一時IDの発行236 $objSiteSess->setUniqId();237 $uniqid = $objSiteSess->getUniqId();238 // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ239 if($pre_uniqid != "") {240 $sqlval['order_temp_id'] = $uniqid;241 $where = "order_temp_id = ?";242 $objQuery = new SC_Query();243 $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));244 }245 // カートを購入モードに設定246 $objCartSess->saveCurrentCart($uniqid);247 // 購入ページへ248 $this->objDisplay->redirect(MOBILE_SHOPPING_URL);249 exit;250 }251 break;252 default:253 break;254 }255 256 if (!isset($_GET['mode'])) $_GET['mode'] = "";257 258 /*259 * FIXME sendRedirect() を使った方が良いが無限ループしてしまう...260 */261 switch($_GET['mode']) {262 case 'up':263 $objCartSess->upQuantity($_GET['cart_no']);264 SC_Utils_Ex::sfReload(session_name() . "=" . session_id());265 break;266 case 'down':267 $objCartSess->downQuantity($_GET['cart_no']);268 SC_Utils_Ex::sfReload(session_name() . "=" . session_id());269 break;270 case 'delete':271 $objCartSess->delProduct($_GET['cart_no']);272 SC_Utils_Ex::sfReload(session_name() . "=" . session_id());273 break;274 }275 276 // カート集計処理277 if (empty($arrData)) {278 $arrData = array();279 }280 $objDb->sfTotalCart($this, $objCartSess);281 $this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, null, $objCustomer);282 283 // 基本情報の取得284 $this->arrInfo = $objSiteInfo->data;285 286 // ログイン判定287 184 if($objCustomer->isLoginSuccess(true)) { 288 185 $this->tpl_login = true; … … 291 188 } 292 189 293 // 送料無料までの金額を計算294 $tpl_deliv_free = $this->arrInfo['free_rule'] - $this->tpl_total_inctax;295 $this->tpl_deliv_free = $tpl_deliv_free;296 297 190 // 前頁のURLを取得 298 191 $this->tpl_prev_url = $objCartSess->getPrevURL();
Note: See TracChangeset
for help on using the changeset viewer.