#210 모바일에서 개별배송비 계산코드 추가

This commit is contained in:
chicpro
2013-06-13 14:23:00 +09:00
parent 7bd59a8f70
commit e7c0eab61d

View File

@ -178,20 +178,40 @@ if ((int)($row['od_amount'] - $tot_cp_amount) !== $i_amount) {
// 배송비가 상이함
$tot_sell_amount = $row['od_amount'];
// 배송비 계산
if ($default['de_send_cost_case'] == "없음") {
if ($default['de_send_cost_case'] == '없음') {
$send_cost = 0;
} else {
} else if($default['de_send_cost_case'] == '상한') {
// 배송비 상한 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < $send_cost_limit[$k]) {
$send_cost = $send_cost_list[$k];
if ($tot_sell_amount < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
$send_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
break;
}
}
} else { // 개별배송비
$send_cost = 0;
$sql = " select it_id
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
and ct_select = '1'
and ct_num = '0'
and ct_send_cost = '0' ";
$result = sql_query($sql);
for($i=0; $sc=sql_fetch_array($result); $i++) {
// 합계
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$sc['it_id']}'
and uq_id = '$tmp_uq_id' ";
$sum = sql_fetch($sql);
$send_cost += get_item_sendcost($sc['it_id'], $sum['price'], $sum['qty']);
}
}
$tot_sc_cp_amount = 0;