Index: /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php (revision 20116)
+++ /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php (revision 20122)
@@ -78,5 +78,5 @@
$objPurchase = new SC_Helper_Purchase_Ex();
- $this->isMultiple = $objPurchase->isMultiple();
+ $this->is_multiple = $objPurchase->isMultiple();
// 前のページで正しく登録手続きが行われた記録があるか判定
@@ -86,7 +86,6 @@
// ユーザユニークIDの取得と購入状態の正当性をチェック
- $uniqid = $objSiteSess->getUniqId();
- $objPurchase->verifyChangeCart($uniqid, $objCartSess);
- $this->tpl_uniqid = $uniqid;
+ $this->tpl_uniqid = $objSiteSess->getUniqId();
+ $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
$this->cartKey = $objCartSess->getKey();
@@ -94,5 +93,5 @@
// カート内商品のチェック
$this->tpl_message = $objCartSess->checkProducts($this->cartKey);
- if (strlen($this->tpl_message) >= 1) {
+ if (!SC_Utils_Ex::isBlank($this->tpl_message)) {
SC_Response_Ex::sendRedirect(CART_URLPATH);
exit;
@@ -100,5 +99,6 @@
// カートの商品を取得
- $this->cartItems = $objCartSess->getCartList($this->cartKey);
+ $this->arrShipping = $objPurchase->getShippingTemp();
+ $this->arrCartItems = $objCartSess->getCartList($this->cartKey);
// 合計金額
$this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey);
@@ -108,11 +108,14 @@
$this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey);
- // TODO リファクタリング
// 一時受注テーブルの読込
- $tmpData = $objPurchase->getOrderTemp($uniqid);
+ $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
// カート集計を元に最終計算
- // FIXME 使用ポイント, 手数料の扱い
- $arrData = array_merge($tmpData, $objCartSess->calculate($this->cartKey, $objCustomer, $tmpData['use_point'], $objPurchase->getShippingPref(), $tmpData['charge'], $tmpData['discount']));
+ $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer,
+ $arrOrderTemp['use_point'],
+ $objPurchase->getShippingPref(),
+ $arrOrderTemp['charge'],
+ $arrOrderTemp['discount']);
+ $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults);
// 会員ログインチェック
@@ -122,15 +125,6 @@
}
- // 決済区分を取得する
- $payment_type = "";
- if($objDb->sfColumnExists("dtb_payment", "memo01")){
- // MEMO03に値が入っている場合には、モジュール追加されたものとみなす
- $sql = "SELECT memo03 FROM dtb_payment WHERE payment_id = ?";
- $arrPayment = $objQuery->getAll($sql, array($arrData['payment_id']));
- $payment_type = $arrPayment[0]["memo03"];
- }
- $this->payment_type = $payment_type;
-
- $this->shipping = $objPurchase->getShippingTemp();
+ // 決済モジュールを使用するかどうか
+ $this->use_module = $this->useModule($this->arrForm['payment_id']);
switch($this->getMode()) {
@@ -143,22 +137,26 @@
break;
case 'confirm':
- // この時点で注文番号を確保しておく(クレジット、コンビニ決済で必要なため)
- $arrData["order_id"] = $objQuery->nextval("dtb_order_order_id");
+ /*
+ * 決済モジュールで必要なため, 受注番号を取得
+ */
+ $this->arrForm["order_id"] = $objQuery->nextval("dtb_order_order_id");
// 集計結果を受注一時テーブルに反映
- $objPurchase->saveOrderTemp($uniqid, $arrData, $objCustomer);
+ $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm,
+ $objCustomer);
+
// 正常に登録されたことを記録しておく
$objSiteSess->setRegistFlag();
- // 決済方法により画面切替
- if($payment_type != "") {
- $_SESSION["payment_id"] = $arrData['payment_id'];
-
+ // 決済モジュールを使用する場合
+ if ($this->use_module) {
+ $_SESSION["payment_id"] = $this->arrForm['payment_id'];
$objPurchase->completeOrder(ORDER_PENDING);
SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH);
- }else{
- // 受注を完了し, 購入完了ページへ
+ }
+ // 購入完了ページ
+ else {
$objPurchase->completeOrder(ORDER_NEW);
- $objPurchase->sendOrderMail($arrData["order_id"]);
+ $objPurchase->sendOrderMail($this->arrForm["order_id"]);
SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH);
}
@@ -168,5 +166,4 @@
break;
}
- $this->arrData = $arrData;
}
@@ -179,4 +176,19 @@
parent::destroy();
}
+
+ /**
+ * 決済モジュールを使用するかどうか.
+ *
+ * dtb_payment.memo03 に値が入っている場合は決済モジュールと見なす.
+ *
+ * @param integer $payment_id 支払い方法ID
+ * @return boolean 決済モジュールを使用する支払い方法の場合 true
+ */
+ function useModule($payment_id) {
+ $objQuery =& SC_Query::getSingletonInstance();
+ $memo03 = $objQuery->get('memo03', 'dtb_payment', 'payment_id = ?',
+ array($payment_id));
+ return !SC_Utils_Ex::isBlank($memo03);
+ }
}
?>
Index: /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping.php (revision 20116)
+++ /branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping.php (revision 20122)
@@ -129,6 +129,6 @@
// モバイルサイトで携帯アドレスの登録が無い場合
- if($this->hasEmailMobile($objCustomer)) {
- SC_Response_Ex::sendRedirect('../entry/email_mobile.php');
+ if(!$this->hasEmailMobile($objCustomer)) {
+ SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php');
exit;
}
@@ -470,7 +470,6 @@
*/
function doLogin(&$objCustomer, $login_email, $login_pass) {
-
switch (SC_Display::detectDevice()) {
- case DEVICE_TYPE_MOBILLE:
+ case DEVICE_TYPE_MOBILE:
if(!$objCustomer->getCustomerDataFromMobilePhoneIdPass($login_pass) &&
!$objCustomer->getCustomerDataFromEmailPass($login_pass, $login_email, true)) {
@@ -503,8 +502,8 @@
function hasEmailMobile(&$objCustomer) {
switch (SC_Display::detectDevice()) {
- case DEVICE_TYPE_MOBILLE:
+ case DEVICE_TYPE_MOBILE:
$objMobile = new SC_Helper_Mobile_Ex();
if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
- if (!$objCustomer->hasValue('email_mobile')) {
+ if ($objCustomer->hasValue('email_mobile')) {
return true;
}
Index: /branches/version-2_5-dev/data/class/SC_Customer.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_Customer.php (revision 19986)
+++ /branches/version-2_5-dev/data/class/SC_Customer.php (revision 20122)
@@ -251,5 +251,8 @@
// パラメータがNULLかどうかの判定
function hasValue($keyname) {
- return isset($_SESSION['customer'][$keyname]);
+ if (isset($_SESSION['customer'][$keyname])) {
+ return !SC_Utils_Ex::isBlank($_SESSION['customer'][$keyname]);
+ }
+ return false;
}
Index: /branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl (revision 20116)
+++ /branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl (revision 20122)
@@ -31,5 +31,5 @@
【ご注文内容】
-
+
:
@@ -44,11 +44,11 @@
商品合計:円
-
+
ポイント値引き:-円
-送料:円
-手数料:円
-合計:円
-(内消費税:円)
+送料:円
+手数料:円
+合計:円
+(内消費税:円)
@@ -58,8 +58,8 @@
【ポイント確認】
ご注文前のポイント:Pt
-ご使用ポイント:-Pt
-お誕生月ポイント:+Pt
-今回加算予定のポイント:+Pt
-
+ご使用ポイント:-Pt
+お誕生月ポイント:+Pt
+今回加算予定のポイント:+Pt
+
加算後のポイント:Pt
@@ -70,6 +70,6 @@
【お届け先】
-
-
+
+
▼お届け先
@@ -98,16 +98,16 @@
【配送方法】
-
+
【お支払い方法】
-
+
-
+
【その他お問い合わせ】
-
+
Index: /branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl (revision 20116)
+++ /branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl (revision 20122)
@@ -47,5 +47,5 @@
下記ご注文内容で送信してもよろしいでしょうか?
- よろしければ、「次へご注文完了ページへ」ボタンをクリックしてください。