コード例 #1
0
 /**
  * 受注一時テーブルへ登録を行う.
  *
  * @param integer $uniqid 受注一時テーブルのユニークID
  * @param array $arrForm フォームの入力値
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param array $arrPayment お支払い方法の配列
  * @return void
  */
 function lfRegistData($uniqid, $arrForm, &$objPurchase, $arrPayment)
 {
     $arrForm['order_temp_id'] = $uniqid;
     $arrForm['update_date'] = 'CURRENT_TIMESTAMP';
     if ($arrForm['point_check'] != '1') {
         $arrForm['use_point'] = 0;
     }
     foreach ($arrPayment as $payment) {
         if ($arrForm['payment_id'] == $payment['payment_id']) {
             $arrForm['charge'] = $payment['charge'];
             $arrForm['payment_method'] = $payment['payment_method'];
             break;
         }
     }
     $objPurchase->saveOrderTemp($uniqid, $arrForm);
 }
コード例 #2
0
 /**
  * 複数配送情報を一時保存する.
  *
  * 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
  *
  * @param integer $uniqid 一時受注テーブルのユニークID
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_CartSession $objCartSess SC_CartSession インスタンス
  * @return void
  */
 function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess, &$objAddress)
 {
     $arrParams = $objFormParam->getSwapArray();
     foreach ($arrParams as $arrParam) {
         $other_deliv_id = $arrParam['shipping'];
         if ($objCustomer->isLoginSuccess(true)) {
             if ($other_deliv_id != 0) {
                 $otherDeliv = $objAddress->getAddress($other_deliv_id);
                 foreach ($otherDeliv as $key => $val) {
                     $arrValues[$other_deliv_id]['shipping_' . $key] = $val;
                 }
             } else {
                 $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
             }
         } else {
             $arrValues = $objPurchase->getShippingTemp();
         }
         $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
     }
     $objPurchase->clearShipmentItemTemp();
     foreach ($arrValues as $shipping_id => $arrVal) {
         $objPurchase->saveShippingTemp($arrVal, $shipping_id);
     }
     foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
         foreach ($arrProductClassIds as $product_class_id => $quantity) {
             if ($quantity == 0) {
                 continue;
             }
             $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
         }
     }
     //不必要な配送先を削除
     foreach ($_SESSION['shipping'] as $id => $arrShipping) {
         if (!isset($arrShipping['shipment_item'])) {
             $objPurchase->unsetOneShippingTemp($id);
         }
     }
     // $arrValues[0] には, 購入者の情報が格納されている
     $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
 }
 /**
  * 複数配送情報を一時保存する.
  *
  * 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
  *
  * @param  integer            $uniqid       一時受注テーブルのユニークID
  * @param  SC_FormParam       $objFormParam SC_FormParam インスタンス
  * @param  SC_Customer        $objCustomer  SC_Customer インスタンス
  * @param  SC_Helper_Purchase $objPurchase  SC_Helper_Purchase インスタンス
  * @return void
  */
 public function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objAddress)
 {
     $arrParams = $objFormParam->getSwapArray();
     foreach ($arrParams as $arrParam) {
         $other_deliv_id = $arrParam['shipping'];
         if ($objCustomer->isLoginSuccess(true)) {
             if ($other_deliv_id != 0) {
                 $otherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id'));
                 if (!$otherDeliv) {
                     SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。");
                     SC_Response_Ex::actionExit();
                 }
                 foreach ($otherDeliv as $key => $val) {
                     $arrValues[$other_deliv_id]['shipping_' . $key] = $val;
                 }
             } else {
                 $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
             }
         } else {
             $arrValues = $objPurchase->getShippingTemp();
         }
         $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
     }
     $objPurchase->clearShipmentItemTemp();
     foreach ($arrValues as $shipping_id => $arrVal) {
         $objPurchase->saveShippingTemp($arrVal, $shipping_id);
     }
     foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
         foreach ($arrProductClassIds as $product_class_id => $quantity) {
             if ($quantity == 0) {
                 continue;
             }
             $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
         }
     }
     //不必要な配送先を削除
     foreach ($_SESSION['shipping'] as $id => $arrShipping) {
         if (!isset($arrShipping['shipment_item'])) {
             $objPurchase->unsetOneShippingTemp($id);
         }
     }
     // $arrValues[0] には, 購入者の情報が格納されている
     $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
 }
コード例 #4
0
 /**
  * データの一時登録を行う.
  *
  * 非会員向けの処理
  * @param integer $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @param boolean $isMultiple 複数配送の場合 true
  */
 function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormParam, $isMultiple = false)
 {
     $arrParams = $objFormParam->getHashArray();
     // 注文者をお届け先とする配列を取得
     $arrShippingOwn = array();
     $objPurchase->copyFromOrder($arrShippingOwn, $arrParams);
     // 都度入力されたお届け先
     $arrShipping = $objPurchase->extractShipping($arrParams);
     if ($isMultiple) {
         $objPurchase->unsetOneShippingTemp(0);
         $objPurchase->unsetOneShippingTemp(1);
         $objPurchase->saveShippingTemp($arrShippingOwn, 0);
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 1);
         }
     } else {
         $objPurchase->unsetAllShippingTemp(true);
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 1);
         } else {
             $objPurchase->saveShippingTemp($arrShippingOwn, 0);
         }
     }
     $arrValues = $objFormParam->getDbArray();
     // 登録データの作成
     $arrValues['order_birth'] = SC_Utils_Ex::sfGetTimestamp($arrParams['year'], $arrParams['month'], $arrParams['day']);
     $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
     $arrValues['customer_id'] = '0';
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
 }
コード例 #5
0
 /**
  * お届け先チェックの値に応じて, お届け先情報を保存する.
  *
  * 会員住所がチェックされている場合は, 会員情報からお届け先を取得する.
  * その他のお届け先がチェックされている場合は, その他のお届け先からお届け先を取得する.
  * お届け先チェックの値が不正な場合は false を返す.
  *
  * @param  integer            $other_deliv_id
  * @param  string             $uniqid         受注一時テーブルのユニークID
  * @param  SC_Helper_Purchase $objPurchase    SC_Helper_Purchase インスタンス
  * @param  SC_Customer        $objCustomer    SC_Customer インスタンス
  * @param SC_Helper_Address_Ex $objAddress
  * @return boolean            お届け先チェックの値が妥当な場合 true
  */
 public function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer, $objAddress)
 {
     $arrValues = array();
     // 会員登録住所がチェックされている場合
     if ($other_deliv_id == 0) {
         $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping');
         // 別のお届け先がチェックされている場合
     } else {
         $arrOtherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id'));
         if (!$arrOtherDeliv) {
             return false;
         }
         $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', '');
     }
     $objPurchase->saveShippingTemp($arrValues, $other_deliv_id);
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
     return true;
 }
コード例 #6
0
 /**
  * お届け先チェックの値に応じて, お届け先情報を保存する.
  *
  * 会員住所がチェックされている場合は, 会員情報からお届け先を取得する.
  * その他のお届け先がチェックされている場合は, その他のお届け先からお届け先を取得する.
  * お届け先チェックの値が不正な場合は false を返す.
  *
  * @param integer $other_deliv_id
  * @param string $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @return boolean お届け先チェックの値が妥当な場合 true
  */
 function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer)
 {
     GC_Utils_Ex::gfDebugLog('register deliv. deliv_check=' . $deliv_check);
     $arrValues = array();
     // 会員登録住所がチェックされている場合
     if ($other_deliv_id == 0) {
         $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping');
     } else {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $arrOtherDeliv = $objQuery->getRow('*', 'dtb_other_deliv', 'customer_id = ? AND other_deliv_id = ?', array($objCustomer->getValue('customer_id'), $other_deliv_id));
         if (empty($arrOtherDeliv)) {
             return false;
         }
         $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', '');
     }
     $objPurchase->saveShippingTemp($arrValues, $other_deliv_id);
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
     return true;
 }
コード例 #7
0
 /**
  * データの一時登録を行う.
  *
  * @param integer $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @param boolean $isMultiple 複数配送の場合 true
  */
 function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormParam, $isMultiple = false)
 {
     $arrParams = $objFormParam->getHashArray();
     $arrValues = $objFormParam->getDbArray();
     // 登録データの作成
     $arrValues['order_birth'] = SC_Utils_Ex::sfGetTimestamp($arrParams['year'], $arrParams['month'], $arrParams['day']);
     $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
     $arrValues['customer_id'] = '0';
     // お届け先を指定しない場合、
     if ($arrParams['deliv_check'] != '1') {
         // order_* を shipping_* へコピー
         $objPurchase->copyFromOrder($arrValues, $arrParams);
     }
     /*
      * order_* と shipping_* をそれぞれ $_SESSION['shipping'][$shipping_id]
      * に, shipping_* というキーで保存
      */
     foreach ($arrValues as $key => $val) {
         if (preg_match('/^order_/', $key)) {
             $arrOrder['shipping_' . str_replace('order_', '', $key)] = $val;
         } elseif (preg_match('/^shipping_/', $key)) {
             $arrShipping[$key] = $val;
         }
     }
     if ($isMultiple) {
         $objPurchase->saveShippingTemp($arrOrder, 0);
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 1);
         }
     } else {
         if ($arrParams['deliv_check'] == '1') {
             $objPurchase->saveShippingTemp($arrShipping, 0);
         } else {
             $objPurchase->saveShippingTemp($arrOrder, 0);
         }
     }
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
 }
コード例 #8
0
 /**
  * お届け先チェックの値に応じて, お届け先情報を保存する.
  *
  * 会員住所がチェックされている場合は, 会員情報からお届け先を取得する.
  * その他のお届け先がチェックされている場合は, その他のお届け先からお届け先を取得する.
  * お届け先チェックの値が不正な場合は false を返す.
  *
  * @param integer $deliv_check お届け先チェック
  * @param string $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @return boolean お届け先チェックの値が妥当な場合 true
  */
 function registerDeliv($deliv_check, $uniqid, &$objPurchase, &$objCustomer)
 {
     $this->log("register deliv. deliv_check=" . $deliv_check, "Debug");
     $arrValues = array();
     // 会員登録住所がチェックされている場合
     if ($deliv_check == '-1') {
         $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping');
         $objPurchase->saveShippingTemp($arrValues);
         $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
         return true;
     } elseif ($deliv_check >= 1) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $arrOtherDeliv = $objQuery->getRow("*", "dtb_other_deliv", "customer_id = ? AND other_deliv_id = ?", array($objCustomer->getValue('customer_id'), $deliv_check));
         if (SC_Utils_Ex::isBlank($arrOtherDeliv)) {
             return false;
         }
         $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', '');
         $objPurchase->saveShippingTemp($arrValues);
         $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
         return true;
     } else {
         return false;
     }
 }
コード例 #9
0
 /**
  * 複数配送情報を一時保存する.
  *
  * 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
  *
  * @param integer $uniqid 一時受注テーブルのユニークID
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_CartSession $objCartSess SC_CartSession インスタンス
  * @return void
  */
 function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess)
 {
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $arrParams = $objFormParam->getSwapArray();
     foreach ($arrParams as $arrParam) {
         $other_deliv_id = $arrParam['shipping'];
         if ($objCustomer->isLoginSuccess(true)) {
             if ($other_deliv_id != 0) {
                 $otherDeliv = $objQuery->select('*', 'dtb_other_deliv', 'other_deliv_id = ?', array($other_deliv_id));
                 foreach ($otherDeliv[0] as $key => $val) {
                     $arrValues[$other_deliv_id]['shipping_' . $key] = $val;
                 }
             } else {
                 $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
             }
         } else {
             $arrValues = $objPurchase->getShippingTemp();
         }
         $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
     }
     $objPurchase->clearShipmentItemTemp();
     foreach ($arrValues as $shipping_id => $arrVal) {
         $objPurchase->saveShippingTemp($arrVal, $shipping_id);
     }
     foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
         foreach ($arrProductClassIds as $product_class_id => $quantity) {
             if ($quantity == 0) {
                 continue;
             }
             $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
         }
     }
     // $arrValues[0] には, 購入者の情報が格納されている
     $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
 }
コード例 #10
0
 /**
  * お届け先チェックの値に応じて, お届け先情報を保存する.
  *
  * 会員住所がチェックされている場合は, 会員情報からお届け先を取得する.
  * その他のお届け先がチェックされている場合は, その他のお届け先からお届け先を取得する.
  * お届け先チェックの値が不正な場合は false を返す.
  *
  * @param integer $other_deliv_id
  * @param string $uniqid 受注一時テーブルのユニークID
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @return boolean お届け先チェックの値が妥当な場合 true
  */
 function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer, $objAddress)
 {
     GC_Utils_Ex::gfDebugLog('register deliv. deliv_check=' . $deliv_check);
     $arrValues = array();
     // 会員登録住所がチェックされている場合
     if ($other_deliv_id == 0) {
         $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping');
     } else {
         $arrOtherDeliv = $objAddress->getAddress($other_deliv_id);
         if (!$arrOtherDeliv) {
             return false;
         }
         $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', '');
     }
     $objPurchase->saveShippingTemp($arrValues, $other_deliv_id);
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
     return true;
 }