Exemplo n.º 1
0
 /**
  * データの一時登録を行う.
  *
  * 非会員向けの処理
  * @param integer            $uniqid       受注一時テーブルのユニークID
  * @param PurchaseHelper $objPurchase  PurchaseHelper インスタンス
  * @param Customer        $objCustomer  Customer インスタンス
  * @param FormParam       $objFormParam FormParam インスタンス
  * @param boolean            $isMultiple   複数配送の場合 true
  */
 public function lfRegistData($uniqid, &$objPurchase, Customer &$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'] = Utils::sfGetTimestamp($arrParams['order_year'], $arrParams['order_month'], $arrParams['order_day']);
     $arrValues['update_date'] = 'CURRENT_TIMESTAMP';
     $arrValues['customer_id'] = '0';
     $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);
 }
Exemplo n.º 2
0
 /**
  * お届け先チェックの値に応じて, お届け先情報を保存する.
  *
  * 会員住所がチェックされている場合は, 会員情報からお届け先を取得する.
  * その他のお届け先がチェックされている場合は, その他のお届け先からお届け先を取得する.
  * お届け先チェックの値が不正な場合は false を返す.
  *
  * @param  integer            $other_deliv_id
  * @param  string             $uniqid         受注一時テーブルのユニークID
  * @param  PurchaseHelper $objPurchase    PurchaseHelper インスタンス
  * @param  Customer        $objCustomer    Customer インスタンス
  * @param AddressHelper $objAddress
  * @return boolean            お届け先チェックの値が妥当な場合 true
  */
 public function registerDeliv($other_deliv_id, $uniqid, PurchaseHelper &$objPurchase, Customer &$objCustomer, AddressHelper $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;
 }