- Timestamp:
- 2007/09/05 11:01:20 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/helper/SC_Helper_DB.php
r15592 r15604 1212 1212 1213 1213 /** 1214 * 集計情報を元に最終計算を行う. 1215 * 1216 * @param array $arrData 各種情報 1217 * @param LC_Page $objPage LC_Page インスタンス 1218 * @param SC_CartSession $objCartSess SC_CartSession インスタンス 1219 * @param array $arrInfo 店舗情報の配列 1220 * @param SC_Customer $objCustomer SC_Customer インスタンス 1221 * @return array 最終計算後の配列 1222 */ 1223 function sfTotalConfirm($arrData, &$objPage, &$objCartSess, $arrInfo, &$objCustomer = "") { 1224 // 未定義変数を定義 1225 if (!isset($arrData['deliv_pref'])) $arrData['deliv_pref'] = ""; 1226 if (!isset($arrData['payment_id'])) $arrData['payment_id'] = ""; 1227 if (!isset($arrData['charge'])) $arrData['charge'] = ""; 1228 if (!isset($arrData['use_point'])) $arrData['use_point'] = ""; 1229 1230 // 商品の合計個数 1231 $total_quantity = $objCartSess->getTotalQuantity(true); 1232 1233 // 税金の取得 1234 $arrData['tax'] = $objPage->tpl_total_tax; 1235 // 小計の取得 1236 $arrData['subtotal'] = $objPage->tpl_total_pretax; 1237 1238 // 合計送料の取得 1239 $arrData['deliv_fee'] = 0; 1240 1241 // 商品ごとの送料が有効の場合 1242 if (OPTION_PRODUCT_DELIV_FEE == 1) { 1243 $arrData['deliv_fee']+= $objCartSess->getAllProductsDelivFee(); 1244 } 1245 1246 // 配送業者の送料が有効の場合 1247 if (OPTION_DELIV_FEE == 1) { 1248 // 送料の合計を計算する 1249 $arrData['deliv_fee'] 1250 += $this->sfGetDelivFee($arrData['deliv_pref'], 1251 $arrData['payment_id']); 1252 1253 } 1254 1255 // 送料無料の購入数が設定されている場合 1256 if(DELIV_FREE_AMOUNT > 0) { 1257 if($total_quantity >= DELIV_FREE_AMOUNT) { 1258 $arrData['deliv_fee'] = 0; 1259 } 1260 } 1261 1262 // 送料無料条件が設定されている場合 1263 if($arrInfo['free_rule'] > 0) { 1264 // 小計が無料条件を超えている場合 1265 if($arrData['subtotal'] >= $arrInfo['free_rule']) { 1266 $arrData['deliv_fee'] = 0; 1267 } 1268 } 1269 1270 // 合計の計算 1271 $arrData['total'] = $objPage->tpl_total_pretax; // 商品合計 1272 $arrData['total']+= $arrData['deliv_fee']; // 送料 1273 $arrData['total']+= $arrData['charge']; // 手数料 1274 // お支払い合計 1275 $arrData['payment_total'] = $arrData['total'] - ($arrData['use_point'] * POINT_VALUE); 1276 // 加算ポイントの計算 1277 $arrData['add_point'] = SC_Utils::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo); 1278 1279 if($objCustomer != "") { 1280 // 誕生日月であった場合 1281 if($objCustomer->isBirthMonth()) { 1282 $arrData['birth_point'] = BIRTH_MONTH_POINT; 1283 $arrData['add_point'] += $arrData['birth_point']; 1284 } 1285 } 1286 1287 if($arrData['add_point'] < 0) { 1288 $arrData['add_point'] = 0; 1289 } 1290 return $arrData; 1291 } 1292 1293 /** 1214 1294 * レコードの存在チェックを行う. 1215 1295 *
Note: See TracChangeset
for help on using the changeset viewer.