/** * Page のプロセス. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->tpl_uniqid = $objSiteSess->getUniqId(); $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $this->tpl_uniqid); $this->tpl_addrmax = count($this->addrs); $this->lfInitParam($objFormParam); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); switch ($this->getMode()) { case 'confirm': $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { // フォームの情報を一時保存しておく $_SESSION['multiple_temp'] = $objFormParam->getHashArray(); $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, $objCustomer, $objPurchase, $objCartSess); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect("payment.php"); exit; } break; default: $this->setParamToSplitItems($objFormParam, $objCartSess); } // 前のページから戻ってきた場合 if ($_GET['from'] == 'multiple') { $objFormParam->setParam($_SESSION['multiple_temp']); } $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のプロセス. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $objAddress = new SC_Helper_Address_Ex(); // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $this->tpl_uniqid = $objSiteSess->getUniqId(); $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $objAddress); $this->tpl_addrmax = count($this->addrs) - 2; // 「選択してください」と会員の住所をカウントしない $this->lfInitParam($objFormParam); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); switch ($this->getMode()) { case 'confirm': $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { // フォームの情報を一時保存しておく $_SESSION['multiple_temp'] = $objFormParam->getHashArray(); $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, $objCustomer, $objPurchase, $objAddress); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect('payment.php'); SC_Response_Ex::actionExit(); } break; default: $this->setParamToSplitItems($objFormParam, $objCartSess); } // 前のページから戻ってきた場合 if ($_GET['from'] == 'multiple') { $objFormParam->setParam($_SESSION['multiple_temp']); } $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のアクション. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->is_multiple = $objPurchase->isMultiple(); // カートの情報を取得 $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); $this->tpl_uniqid = $objSiteSess->getUniqId(); $cart_key = $objCartSess->getKey(); $this->cartKey = $cart_key; $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); // 配送業者を取得 $this->arrDeliv = $objPurchase->getDeliv($cart_key); $this->is_single_deliv = $this->isSingleDeliv($this->arrDeliv); // 会員情報の取得 if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '******'; $this->tpl_user_point = $objCustomer->getValue('point'); $this->name01 = $objCustomer->getValue('name01'); $this->name02 = $objCustomer->getValue('name02'); } // 戻り URL の設定 // @deprecated 2.12.0 テンプレート直書きに戻した $this->tpl_back_url = '?mode=return'; $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); // 正常に受注情報が格納されていない場合はカート画面へ戻す if (SC_Utils_Ex::isBlank($arrOrderTemp)) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } // カート内商品の妥当性チェック $this->tpl_message = $objCartSess->checkProducts($cart_key); if (strlen($this->tpl_message) >= 1) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } /* * 購入金額の取得 * ここでは送料を加算しない */ $this->arrPrices = $objCartSess->calculate($cart_key, $objCustomer); // お届け日一覧の取得 $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $cart_key); switch ($this->getMode()) { /* * 配送業者選択時のアクション * モバイル端末以外の場合は, JSON 形式のデータを出力し, ajax で取得する. */ case 'select_deliv': $this->setFormParams($objFormParam, $arrOrderTemp, true, $this->arrShipping); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); if (SC_Utils_Ex::isBlank($this->arrErr)) { $deliv_id = $objFormParam->getValue('deliv_id'); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $arrSelectedDeliv['error'] = false; } else { $arrSelectedDeliv = array('error' => true); $this->tpl_mainpage = 'shopping/select_deliv.tpl'; // モバイル用 } if (SC_Display_Ex::detectDevice() != DEVICE_TYPE_MOBILE) { echo SC_Utils_Ex::jsonEncode($arrSelectedDeliv); SC_Response_Ex::actionExit(); } else { $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; } break; // 登録処理 // 登録処理 case 'confirm': // パラメーター情報の初期化 $this->setFormParams($objFormParam, $_POST, false, $this->arrShipping); $deliv_id = $objFormParam->getValue('deliv_id'); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; $this->img_show = $arrSelectedDeliv['img_show']; $this->arrErr = $this->lfCheckError($objFormParam, $this->arrPrices['subtotal'], $this->tpl_user_point); if (empty($this->arrErr)) { $this->saveShippings($objFormParam, $this->arrDelivTime); $this->lfRegistData($this->tpl_uniqid, $objFormParam->getDbArray(), $objPurchase, $this->arrPayment); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // 確認ページへ移動 SC_Response_Ex::sendRedirect(SHOPPING_CONFIRM_URLPATH); SC_Response_Ex::actionExit(); } break; // 前のページに戻る // 前のページに戻る case 'return': // 正常な推移であることを記録しておく $objSiteSess->setRegistFlag(); $url = null; if ($this->is_multiple) { $url = MULTIPLE_URLPATH . '?from=multiple'; } elseif ($objCustomer->isLoginSuccess(true)) { if ($product_type_id == PRODUCT_TYPE_DOWNLOAD) { $url = CART_URLPATH; } else { $url = DELIV_URLPATH; } } else { $url = SHOPPING_URL . '?from=nonmember'; } SC_Response_Ex::sendRedirect($url); SC_Response_Ex::actionExit(); break; default: // FIXME 前のページから戻ってきた場合は別パラメーター(mode)で処理分岐する必要があるのかもしれない $this->setFormParams($objFormParam, $arrOrderTemp, false, $this->arrShipping); if (!$this->is_single_deliv) { $deliv_id = $objFormParam->getValue('deliv_id'); } else { $deliv_id = $this->arrDeliv[0]['deliv_id']; } if (!SC_Utils_Ex::isBlank($deliv_id)) { $objFormParam->setValue('deliv_id', $deliv_id); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; $this->img_show = $arrSelectedDeliv['img_show']; } break; } // モバイル用 ポストバック処理 if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && SC_Utils_Ex::isBlank($this->arrErr)) { $this->tpl_mainpage = $this->getMobileMainpage($this->is_single_deliv, $this->getMode()); } $this->arrForm = $objFormParam->getFormParamList(); }
/** * 受注登録を完了する. * * 引数の受注情報を受注テーブル及び受注詳細テーブルに登録する. * 登録後, 受注一時テーブルに削除フラグを立てる. * * @param array $orderParams 登録する受注情報の配列 * @param SC_CartSession $objCartSession カート情報のインスタンス * @param integer $cartKey 登録を行うカート情報のキー * @param integer 受注ID */ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) { $objQuery =& SC_Query_Ex::getSingletonInstance(); // 不要な変数を unset $unsets = array('mailmaga_flg', 'deliv_check', 'point_check', 'password', 'reminder', 'reminder_answer', 'mail_flag', 'session'); foreach ($unsets as $unset) { unset($orderParams[$unset]); } // 対応状況の指定が無い場合は新規受付 if (SC_Utils_Ex::isBlank($orderParams['status'])) { $orderParams['status'] = ORDER_NEW; } $orderParams['del_flg'] = '0'; $orderParams['create_date'] = 'CURRENT_TIMESTAMP'; $orderParams['update_date'] = 'CURRENT_TIMESTAMP'; $this->registerOrder($orderParams['order_id'], $orderParams); // 詳細情報を取得 $cartItems = $objCartSession->getCartList($cartKey, $orderParams['order_pref'], $orderParams['order_country_id']); // 詳細情報を生成 $objProduct = new SC_Product_Ex(); $i = 0; $arrDetail = array(); foreach ($cartItems as $item) { $p =& $item['productsClass']; $arrDetail[$i]['order_id'] = $orderParams['order_id']; $arrDetail[$i]['product_id'] = $p['product_id']; $arrDetail[$i]['product_class_id'] = $p['product_class_id']; $arrDetail[$i]['product_name'] = $p['name']; $arrDetail[$i]['product_code'] = $p['product_code']; $arrDetail[$i]['classcategory_name1'] = $p['classcategory_name1']; $arrDetail[$i]['classcategory_name2'] = $p['classcategory_name2']; $arrDetail[$i]['point_rate'] = $item['point_rate']; $arrDetail[$i]['price'] = $item['price']; $arrDetail[$i]['quantity'] = $item['quantity']; $arrDetail[$i]['tax_rate'] = $item['tax_rate']; $arrDetail[$i]['tax_rule'] = $item['tax_rule']; $arrDetail[$i]['tax_adjuts'] = $item['tax_adjust']; // 在庫の減少処理 if (!$objProduct->reduceStock($p['product_class_id'], $item['quantity'])) { $objQuery->rollback(); SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true); } $i++; } $this->registerOrderDetail($orderParams['order_id'], $arrDetail); $objQuery->update('dtb_order_temp', array('del_flg' => 1), 'order_temp_id = ?', array(SC_SiteSession_Ex::getUniqId())); return $orderParams['order_id']; }
/** * カートを購入モードに設定 * * @param SC_SiteSession_Ex $objSiteSess * @param SC_CartSession_Ex $objCartSess * @return void */ public function lfSetCurrentCart(&$objSiteSess, &$objCartSess, $cartKey) { // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); $pre_uniqid = $objSiteSess->getUniqId(); // 注文一時IDの発行 $objSiteSess->setUniqId(); $uniqid = $objSiteSess->getUniqId(); // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ if ($pre_uniqid != '') { $this->lfUpdateOrderTempid($pre_uniqid, $uniqid); } // カートを購入モードに設定 $objCartSess->registerKey($cartKey); $objCartSess->saveCurrentCart($uniqid, $cartKey); }
/** * Page のプロセス. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = new SC_FormParam_Ex(); $objAddress = new SC_Helper_Address_Ex(); $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // ログインチェック if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } // ダウンロード商品の場合は、支払方法画面に転送 if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) { $objPurchase->copyFromCustomer($sqlval, $objCustomer, 'shipping'); $objPurchase->saveShippingTemp($sqlval); $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval, $objCustomer); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect('payment.php'); SC_Response_Ex::actionExit(); } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $arrErr = $objFormParam->checkError(); if (!SC_Utils_Ex::isBlank($arrErr)) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $arrForm = $objFormParam->getHashArray(); switch ($this->getMode()) { // 削除 case 'delete': if (!$objAddress->deleteAddress($arrForm['other_deliv_id'], $objCustomer->getValue('customer_id'))) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); SC_Response_Ex::actionExit(); } break; // 会員登録住所に送る // 会員登録住所に送る case 'customer_addr': $objPurchase->unsetShippingTemp(); $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check']; $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer, $objAddress); if (!$success) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); } $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); SC_Response_Ex::actionExit(); break; // 前のページに戻る // 前のページに戻る case 'return': // 確認ページへ移動 SC_Response_Ex::sendRedirect(CART_URL); SC_Response_Ex::actionExit(); break; // お届け先複数指定 // お届け先複数指定 case 'multiple': // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } SC_Response_Ex::sendRedirect('multiple.php'); SC_Response_Ex::actionExit(); break; default: // 配送IDの取得 $shippingData = $objPurchase->getShippingTemp(); if (!SC_Utils_Ex::isBlank($shippingData)) { $arrShippingId = array_keys($shippingData); } if (isset($arrShippingId[0])) { $this->arrForm['deliv_check']['value'] = $arrShippingId[0] == 0 ? -1 : $arrShippingId[0]; } break; } // 登録済み住所を取得 $addr = array(array('other_deliv_id' => NULL, 'customer_id' => $objCustomer->getValue('customer_id'), 'name01' => $objCustomer->getValue('name01'), 'name02' => $objCustomer->getValue('name02'), 'kana01' => $objCustomer->getValue('kana01'), 'kana02' => $objCustomer->getValue('kana02'), 'company_name' => $objCustomer->getValue('company_name'), 'country_id' => $objCustomer->getValue('country_id'), 'zipcode' => $objCustomer->getValue('zipcode'), 'zip01' => $objCustomer->getValue('zip01'), 'zip02' => $objCustomer->getValue('zip02'), 'pref' => $objCustomer->getValue('pref'), 'addr01' => $objCustomer->getValue('addr01'), 'addr02' => $objCustomer->getValue('addr02'), 'tel01' => $objCustomer->getValue('tel01'), 'tel02' => $objCustomer->getValue('tel02'), 'tel03' => $objCustomer->getValue('tel03'))); $this->arrAddr = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); $this->tpl_addrmax = count($this->arrAddr) - 1; // 会員の住所をカウントしない }
/** * Page のプロセス. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objCookie = new SC_Cookie_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objFormParam = new SC_FormParam_Ex(); $nonmember_mainpage = 'shopping/nonmember_input.tpl'; $nonmember_title = 'お客様情報入力'; $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // ログイン済みの場合は次画面に遷移 if ($objCustomer->isLoginSuccess(true)) { SC_Response_Ex::sendRedirect($this->getNextlocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess)); SC_Response_Ex::actionExit(); } else { if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) { $msg = 'ダウンロード商品を含むお買い物は、会員登録が必要です。<br/>' . 'お手数ですが、会員登録をお願いします。'; SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, $msg); SC_Response_Ex::actionExit(); } } switch ($this->getMode()) { // ログイン実行 case 'login': $this->lfInitLoginFormParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->trimParam(); $objFormParam->convParam(); $objFormParam->toLower('login_email'); $this->arrErr = $objFormParam->checkError(); // ログイン判定 if (SC_Utils_Ex::isBlank($this->arrErr) && $objCustomer->doLogin($objFormParam->getValue('login_email'), $objFormParam->getValue('login_pass'))) { // モバイルサイトで携帯アドレスの登録が無い場合、携帯アドレス登録ページへ遷移 if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { if (!$objCustomer->hasValue('email_mobile')) { SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); SC_Response_Ex::actionExit(); } } elseif (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo SC_Utils_Ex::jsonEncode(array('success' => $this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess))); SC_Response_Ex::actionExit(); } SC_Response_Ex::sendRedirect($this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess)); SC_Response_Ex::actionExit(); } else { // 仮登録の場合 if (SC_Helper_Customer_Ex::checkTempCustomer($objFormParam->getValue('login_email'))) { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); SC_Response_Ex::actionExit(); } } else { if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); SC_Response_Ex::actionExit(); } } } break; // お客様情報登録 // お客様情報登録 case 'nonmember_confirm': $this->tpl_mainpage = $nonmember_mainpage; $this->tpl_title = $nonmember_title; $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam); $arrParams = $objFormParam->getHashArray(); $shipping_id = $arrParams['deliv_check'] == '1' ? 1 : 0; $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); SC_Response_Ex::actionExit(); } break; // 前のページに戻る // 前のページに戻る case 'return': SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); break; // 複数配送ページへ遷移 // 複数配送ページへ遷移 case 'multiple': // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam, true); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(MULTIPLE_URLPATH); SC_Response_Ex::actionExit(); } $this->tpl_mainpage = $nonmember_mainpage; $this->tpl_title = $nonmember_title; break; // お客様情報入力ページの表示 // お客様情報入力ページの表示 case 'nonmember': $this->tpl_mainpage = $nonmember_mainpage; $this->tpl_title = $nonmember_title; $this->lfInitParam($objFormParam); // ※breakなし // ※breakなし default: // 前のページから戻ってきた場合は, お客様情報入力ページ if (isset($_GET['from']) && $_GET['from'] == 'nonmember') { $this->tpl_mainpage = $nonmember_mainpage; $this->tpl_title = $nonmember_title; $this->lfInitParam($objFormParam); } else { $this->lfInitLoginFormParam($objFormParam); } $this->setFormParams($objFormParam, $objPurchase, $this->tpl_uniqid); break; } // 記憶したメールアドレスを取得 $this->tpl_login_email = $objCookie->getCookie('login_email'); if (!SC_Utils_Ex::isBlank($this->tpl_login_email)) { $this->tpl_login_memory = '1'; } // 入力値の取得 $this->arrForm = $objFormParam->getFormParamList(); // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); } }
/** * Page のプロセス. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // ログインチェック if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } // ダウンロード商品の場合は、支払方法画面に転送 if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) { $objPurchase->copyFromCustomer($sqlval, $objCustomer, 'shipping'); $objPurchase->saveShippingTemp($sqlval); $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval, $objCustomer); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect('payment.php'); SC_Response_Ex::actionExit(); } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $arrErr = $objFormParam->checkError(); if (!SC_Utils_Ex::isBlank($arrErr)) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $arrForm = $objFormParam->getHashArray(); switch ($this->getMode()) { // 削除 case 'delete': $this->doDelete($arrForm['other_deliv_id']); break; // 会員登録住所に送る // 会員登録住所に送る case 'customer_addr': $objPurchase->unsetShippingTemp(); $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check']; $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer); if (!$success) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); } $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); SC_Response_Ex::actionExit(); break; // 前のページに戻る // 前のページに戻る case 'return': // 確認ページへ移動 SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); break; // お届け先複数指定 // お届け先複数指定 case 'multiple': // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } SC_Response_Ex::sendRedirect('multiple.php'); SC_Response_Ex::actionExit(); break; default: // 配送IDの取得 $shippingData = $objPurchase->getShippingTemp(); $arrShippingId = array_keys($shippingData); if (isset($arrShippingId[0])) { $this->arrForm['deliv_check']['value'] = $arrShippingId[0] == 0 ? -1 : $arrShippingId[0]; } break; } // 登録済み住所を取得 $this->arrAddr = $objCustomer->getCustomerAddress($objCustomer->getValue('customer_id')); $this->tpl_addrmax = count($this->arrAddr); }
/** * Page のプロセス. * * @return void */ function action() { $objSiteSess = new SC_SiteSession_Ex(); $objCartSess = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objFormParam = new SC_FormParam_Ex(); $objCookie = new SC_Cookie_Ex(COOKIE_EXPIRE); $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // ログインチェック if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } // ダウンロード商品の場合は、支払方法画面に転送 if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) { $objPurchase->copyFromCustomer($sqlval, $objCustomer, 'shipping'); $objPurchase->saveShippingTemp($sqlval); $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval, $objCustomer); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect('payment.php'); exit; } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $arrErr = $objFormParam->checkError(); if (!SC_Utils_Ex::isBlank($arrErr)) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); exit; } $arrForm = $objFormParam->getHashArray(); switch ($this->getMode()) { // 削除 case 'delete': $this->doDelete($arrForm['other_deliv_id']); break; // 会員登録住所に送る // 会員登録住所に送る case 'customer_addr': $objPurchase->unsetShippingTemp(); if ($this->registerDeliv($arrForm['deliv_check'], $this->tpl_uniqid, $objPurchase, $objCustomer)) { $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); exit; } else { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); } break; // 前のページに戻る // 前のページに戻る case 'return': // 確認ページへ移動 SC_Response_Ex::sendRedirect(CART_URLPATH); exit; break; // お届け先複数指定 // お届け先複数指定 case 'multiple': SC_Response_Ex::sendRedirect('multiple.php'); exit; break; } // 登録済み住所を取得 $this->arrAddr = $objCustomer->getCustomerAddress($objCustomer->getValue('customer_id')); $this->tpl_addrmax = count($this->arrAddr); }