- Timestamp:
- 2012/03/12 15:35:03 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php
r21596 r21629 122 122 $objPurchase->unsetShippingTemp(); 123 123 124 $success = $this->registerDeliv($arrForm['deliv_check'], $this->tpl_uniqid, $objPurchase, $objCustomer); 124 $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check']; 125 $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer); 125 126 if (!$success) { 126 127 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); 127 128 } 128 129 129 $objPurchase->setShipmentItemTempForSole($objCartSess );130 $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id); 130 131 $objSiteSess->setRegistFlag(); 131 132 SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); … … 158 159 exit; 159 160 break; 161 160 162 default: 163 // 配送IDの取得 164 $shippingData = $objPurchase->getShippingTemp(); 165 $arrShippingId = array_keys($shippingData); 166 if (isset($arrShippingId[0])) { 167 $this->arrForm['deliv_check']['value'] = $arrShippingId[0] == 0 ? -1 : $arrShippingId[0]; 168 } 161 169 break; 162 170 } … … 210 218 * お届け先チェックの値が不正な場合は false を返す. 211 219 * 212 * @param integer $ deliv_check お届け先チェック220 * @param integer $other_deliv_id 213 221 * @param string $uniqid 受注一時テーブルのユニークID 214 222 * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス … … 216 224 * @return boolean お届け先チェックの値が妥当な場合 true 217 225 */ 218 function registerDeliv($ deliv_check, $uniqid, &$objPurchase, &$objCustomer) {226 function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer) { 219 227 GC_Utils_Ex::gfDebugLog('register deliv. deliv_check=' . $deliv_check); 220 228 $arrValues = array(); 221 229 // 会員登録住所がチェックされている場合 222 if ($ deliv_check == '-1') {230 if ($other_deliv_id == 0) { 223 231 $objPurchase->copyFromCustomer($arrValues, $objCustomer, 'shipping'); 224 $objPurchase->saveShippingTemp($arrValues);225 $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer);226 return true;227 232 } 228 233 // 別のお届け先がチェックされている場合 229 else if ($deliv_check >= 1){234 else { 230 235 $objQuery =& SC_Query_Ex::getSingletonInstance(); 231 236 $arrOtherDeliv = $objQuery->getRow('*', 'dtb_other_deliv', 232 237 'customer_id = ? AND other_deliv_id = ?', 233 array($objCustomer->getValue('customer_id'), $ deliv_check));234 if ( SC_Utils_Ex::isBlank($arrOtherDeliv)) {238 array($objCustomer->getValue('customer_id'), $other_deliv_id)); 239 if (empty($arrOtherDeliv)) { 235 240 return false; 236 241 } 237 242 238 243 $objPurchase->copyFromOrder($arrValues, $arrOtherDeliv, 'shipping', ''); 239 $objPurchase->saveShippingTemp($arrValues); 240 $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer); 241 return true; 242 } 243 // お届け先チェックが不正な場合 244 else { 245 return false; 246 } 244 } 245 $objPurchase->saveShippingTemp($arrValues, $other_deliv_id); 246 $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer); 247 return true; 247 248 } 248 249 }
Note: See TracChangeset
for help on using the changeset viewer.