/**
  * 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();
 }
 function EndSession()
 {
     // セッション情報破棄の前にcustomer_idを保存
     $customer_id = $_SESSION['customer']['customer_id'];
     // $_SESSION['customer']の解放
     unset($_SESSION['customer']);
     // セッションの配送情報を全て破棄する
     SC_Helper_Purchase_Ex::unsetAllShippingTemp(true);
     // トランザクショントークンの破棄
     SC_Helper_Session_Ex::destroyToken();
     $objSiteSess = new SC_SiteSession_Ex();
     $objSiteSess->unsetUniqId();
     // ログに記録する
     $log = sprintf("logout : user=%d\tip=%s", $customer_id, $this->getRemoteHost());
     GC_Utils_Ex::gfPrintLog($log, CUSTOMER_LOG_REALFILE, false);
 }
 /**
  * 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();
 }
 /**
  * セッションに保持している情報を破棄する.
  *
  * 通常、受注処理(completeOrder)完了後に呼び出され、
  * セッション情報を破棄する.
  *
  * 決済モジュール画面から確認画面に「戻る」場合を考慮し、
  * セッション情報を破棄しないカスタマイズを、モジュール側で
  * 加える機会を与える.
  *
  * $orderId が使われていない。
  *
  * @param integer        $orderId        注文番号
  * @param SC_CartSession $objCartSession カート情報のインスタンス
  * @param SC_Customer    $objCustomer    SC_Customer インスタンス
  * @param integer        $cartKey        登録を行うカート情報のキー
  */
 public function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartKey)
 {
     // カートの内容を削除する.
     $objCartSession->delAllProducts($cartKey);
     SC_SiteSession_Ex::unsetUniqId();
     // セッションの配送情報を破棄する.
     $this->unsetAllShippingTemp(true);
     $objCustomer->updateSession();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objCartSess = new SC_CartSession_Ex();
     $objSiteSess = new SC_SiteSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objHelperMail = new SC_Helper_Mail_Ex();
     $this->is_multiple = $objPurchase->isMultiple();
     // 前のページで正しく登録手続きが行われた記録があるか判定
     if (!$objSiteSess->isPrePage()) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess);
     }
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     $this->cartKey = $objCartSess->getKey();
     // カート内商品のチェック
     $this->tpl_message = $objCartSess->checkProducts($this->cartKey);
     if (!SC_Utils_Ex::isBlank($this->tpl_message)) {
         SC_Response_Ex::sendRedirect(CART_URLPATH);
         SC_Response_Ex::actionExit();
     }
     // カートの商品を取得
     $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple);
     $this->arrCartItems = $objCartSess->getCartList($this->cartKey);
     // 合計金額
     $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey);
     // 税額
     $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey);
     // ポイント合計
     $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey);
     // 一時受注テーブルの読込
     $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
     // カート集計を元に最終計算
     $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref($this->is_multiple), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']);
     $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults);
     // 会員ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = '******';
         $this->tpl_user_point = $objCustomer->getValue('point');
     }
     // 決済モジュールを使用するかどうか
     $this->use_module = SC_Helper_Payment_Ex::useModule($this->arrForm['payment_id']);
     switch ($this->getMode()) {
         // 前のページに戻る
         case 'return':
             // 正常な推移であることを記録しておく
             $objSiteSess->setRegistFlag();
             SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH);
             SC_Response_Ex::actionExit();
             break;
         case 'confirm':
             /*
              * 決済モジュールで必要なため, 受注番号を取得
              */
             $this->arrForm['order_id'] = $objPurchase->getNextOrderID();
             $_SESSION['order_id'] = $this->arrForm['order_id'];
             // 集計結果を受注一時テーブルに反映
             $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, $objCustomer);
             // 正常に登録されたことを記録しておく
             $objSiteSess->setRegistFlag();
             // 決済モジュールを使用する場合
             if ($this->use_module) {
                 $objPurchase->completeOrder(ORDER_PENDING);
                 SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH);
             } else {
                 $objPurchase->completeOrder(ORDER_NEW);
                 $template_id = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? 2 : 1;
                 $objHelperMail->sfSendOrderMail($this->arrForm['order_id'], $template_id);
                 SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH);
             }
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
 }
Exemple #7
0
 /**
  * カートを購入モードに設定
  *
  * @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);
 }
Exemple #12
0
 function EndSession()
 {
     // $_SESSION['customer']の解放
     unset($_SESSION['customer']);
     // トランザクショントークンの破棄
     SC_Helper_Session_Ex::destroyToken();
     $objSiteSess = new SC_SiteSession_Ex();
     $objSiteSess->unsetUniqId();
     // ログに記録する
     GC_Utils_Ex::gfPrintLog("logout : user="******"\t" . "ip=" . $this->getRemoteHost(), CUSTOMER_LOG_REALFILE);
 }