#211 주문시 추가배송비 처리 코드 추가

This commit is contained in:
chicpro
2013-06-17 15:50:06 +09:00
parent 97d9e2e097
commit 04ec45c0c5
18 changed files with 231 additions and 29 deletions

View File

@ -133,7 +133,7 @@ $sql = " update {$g4['shop_default_table']}
de_sms_use4 = '$de_sms_use4',
de_sms_use5 = '$de_sms_use5',
de_sms_hp = '$de_sms_hp',
de_item_use_use = '$de_item_use_use',
de_item_use_use = '$de_item_use_use',
de_code_dup_use = '$de_code_dup_use',
de_cart_keep_term = '$de_cart_keep_term',
de_guest_cart_use = '$de_guest_cart_use',

View File

@ -134,7 +134,7 @@ $pg_anchor = '<ul class="anchor">
</tr>
<?php
}
if ($i == 0) echo '<tr><td colspan="5">자료가 없습니다.</td></tr>';
if ($i == 0) echo '<tr><td colspan="5" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table>

View File

@ -243,8 +243,8 @@ $pg_anchor = '<ul class="anchor">
<?php echo $pg_anchor; ?>
<?php
// 주문금액 = 상품구입금액 + 배송비
$amount['정상'] = $t_ct_amount['정상'] + $od['od_send_cost'];
// 주문금액 = 상품구입금액 + 배송비 + 추가배송비
$amount['정상'] = $t_ct_amount['정상'] + $od['od_send_cost'] + $od['od_send_cost2'];
// 입금액 = 결제금액 + 포인트
$amount['입금'] = $od['od_receipt_amount'] + $od['od_receipt_point'];
@ -430,6 +430,12 @@ $pg_anchor = '<ul class="anchor">
<input type="text" name="od_send_cost" value="<?php echo $od['od_send_cost']; ?>" id="od_send_cost" class="frm_input" size="10"> 원
</td>
</tr>
<tr>
<th scope="row"><label for="od_send_cost2">추가배송비</label></th>
<td>
<input type="text" name="od_send_cost2" value="<?php echo $od['od_send_cost2']; ?>" id="od_send_cost2" class="frm_input" size="10"> 원
</td>
</tr>
<?php
if ($amount['미수'] == 0) {
if ($od['od_receipt_amount'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '가상계좌' || $od['od_settle_case'] == '계좌이체')) {

View File

@ -26,6 +26,8 @@ $sql = " update {$g4['shop_order_table']}
od_invoice_time = '$od_invoice_time' ";
if (isset($od_send_cost))
$sql .= " , od_send_cost = '$od_send_cost' ";
if (isset($od_send_cost2))
$sql .= " , od_send_cost2 = '$od_send_cost2' ";
$sql .= " where od_id = '$od_id' ";
sql_query($sql);

View File

@ -32,13 +32,13 @@ if (G4_HTTPS_DOMAIN) {
define(_MISU_QUERY_, "
count(distinct a.od_id) as ordercount, /* 주문서건수 */
count(b.ct_id) as itemcount, /* 상품건수 */
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) as orderamount, /* 주문합계 */
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost + a.od_send_cost2) as orderamount, /* 주문합계 */
(SUM(b.cp_amount) + a.od_coupon) as couponamount, /* 쿠폰합계*/
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) as ordercancel, /* 주문취소 */
(a.od_receipt_amount + a.od_receipt_point) as receiptamount, /* 입금합계 */
(a.od_refund_amount + a.od_cancel_card) as receiptcancel, /* 입금취소 */
(
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) -
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost + a.od_send_cost2) -
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) -
a.od_dc_amount -
(a.od_receipt_amount + a.od_receipt_point) +

View File

@ -326,6 +326,14 @@ if(!$result) {
PRIMARY KEY (`sc_id`),
KEY `sc_zip1` (`sc_zip1`),
KEY `sc_zip2` (`sc_zip2`)
)", true);
)", false);
}
// od_send_cost2 추가
$sql = " select od_send_cost2 from {$g4['shop_order_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_order_table']}`
ADD `od_send_cost2` INT(11) NOT NULL DEFAULT '0' AFTER `od_send_coupon` ", false);
}
?>

View File

@ -284,7 +284,7 @@ if($shop_install) {
de_simg_height = '$simg_height',
de_mimg_width = '$mimg_width',
de_mimg_height = '$mimg_height',
de_item_ps_use = '1',
de_item_use_use = '1',
de_level_sell = '1',
de_code_dup_use = '1',
de_sms_cont1 = '{이름}님의 회원가입을 축하드립니다.\nID:{회원아이디}\n{회사명}',

View File

@ -280,7 +280,7 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
`de_sms_hp` varchar(255) NOT NULL DEFAULT '',
`de_kcp_mid` varchar(255) NOT NULL DEFAULT '',
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_ps_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_use_use` tinyint(4) NOT NULL DEFAULT '0',
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
`de_cart_keep_term` int(11) NOT NULL DEFAULT '0',
`de_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
@ -598,6 +598,7 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_memo` text NOT NULL,
`od_send_cost` int(11) NOT NULL DEFAULT '0',
`od_send_coupon` int(11) NOT NULL DEFAULT '0',
`od_send_cost2` int(11) NOT NULL DEFAULT '0',
`od_temp_amount` int(11) NOT NULL DEFAULT '0',
`od_temp_point` int(11) NOT NULL DEFAULT '0',
`od_receipt_amount` int(11) NOT NULL DEFAULT '0',

View File

@ -294,6 +294,8 @@ ob_end_clean();
<input type="hidden" name="org_od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="org_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="od_send_cost2" value="0">
<input type="hidden" name="item_coupon" value="0">
<?php echo $content; ?>
@ -478,6 +480,10 @@ ob_end_clean();
<tr>
<th>총 주문금액</th>
<td><span id="od_tot_amount"><?php echo number_format($tot_amount); ?></span>원</td>
</tr>
<tr>
<th>추가배송비</th>
<td><span id="od_send_cost2">0</span>원 (지역에 따라 추가되는 도선료 등의 배송비입니다.)</td>
</tr>
</tbody>
</table>
@ -701,6 +707,7 @@ ob_end_clean();
$(function() {
var $cp_btn_el;
var $cp_row_el;
var zipcode = "";
$(".it_coupon_btn").click(function() {
$cp_btn_el = $(this);
@ -802,6 +809,7 @@ $(function() {
var subj = $el.find("input[name='o_cp_subj[]']").val();
var od_amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = $("input[name=org_send_cost]").val();
var item_coupon = parseInt($("input[name=item_coupon]").val());
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
@ -811,8 +819,10 @@ $(function() {
$("input[name=od_send_cost]").val(send_cost);
$("input[name=sc_cp_id]").val("");
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
$("input[name=od_amount]").val(od_amount - amount);
$("input[name=od_amount]").val(od_amount - item_coupon - amount);
$("input[name=od_cp_id]").val(cp_id);
calculate_order_amount();
$("#od_coupon_frm").remove();
@ -828,11 +838,16 @@ $(function() {
$("#od_coupon_cancel").live("click", function() {
var org_amount = $("input[name=org_od_amount]").val();
$("input[name=od_amount]").val(org_amount);
var item_coupon = parseInt($("input[name=item_coupon]").val());
$("input[name=od_amount]").val(org_amount - item_coupon);
$("input[name=od_send_cost]").val($("input[name=org_send_cost]").val());
$("input[name=sc_cp_id]").val("");
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").text("쿠폰적용").focus();
$(this).remove();
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
});
$("#sc_coupon_btn").click(function() {
@ -885,6 +900,21 @@ $(function() {
$(this).remove();
});
$("#od_b_addr2").focus(function() {
var zip1 = $("#od_b_zip1").val().replace(/[^0-9]/g, "");
var zip2 = $("#od_b_zip2").val().replace(/[^0-9]/g, "");
if(zip1 == "" || zip2 == "")
return false;
var code = String(zip1) + String(zip2);
if(zipcode == code)
return false;
zipcode = code;
calculate_sendcost(code);
});
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
@ -931,14 +961,22 @@ function calculate_total_amount()
$("#ct_tot_amount").text(number_format(String(tot_sell_amount))+" 원");
$("input[name=good_mny]").val(tot_sell_amount);
$("input[name=od_amount]").val(sell_amount);
$("input[name=org_od_amount]").val(sell_amount);
$("input[name=od_amount]").val(sell_amount - tot_cp_amount);
$("input[name=od_send_cost]").val(send_cost);
<?php if($od_cnt > 0) { ?>
$("input[name=item_coupon]").val(tot_cp_amount);
<?php if($oc_cnt > 0) { ?>
$("input[name=od_cp_id]").val("");
if($("#od_coupon_cancel").size()) {
$("#od_coupon_btn").text("쿠폰적용");
$("#od_coupon_cancel").remove();
}
<?php } ?>
<?php if($sc_cnt > 0) { ?>
$("input[name=sc_cp_id]").val("");
if($("#sc_coupon_cancel").size()) {
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
}
<?php } ?>
$("input[name=od_temp_point]").val(0);
<?php if($temp_point > 0 && $is_member) { ?>
@ -951,7 +989,8 @@ function calculate_order_amount()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var tot_amount = sell_amount + send_cost;
var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
var tot_amount = sell_amount + send_cost + send_cost2;
$("form[name=sm_form] input[name=good_mny]").val(tot_amount);
$("#od_tot_amount").text(number_format(String(tot_amount)));
@ -982,6 +1021,20 @@ function calculate_temp_point()
$("input[name=max_temp_point]").val(temp_point);
}
function calculate_sendcost(code)
{
$.post(
"./ordersendcost.php",
{ zipcode: code },
function(data) {
$("input[name=od_send_cost2]").val(data);
$("#od_send_cost2").text(number_format(String(data)));
calculate_order_amount();
}
);
}
/* 결제방법에 따른 처리 후 결제등록요청 실행 */
function kcp_approval()
{
@ -1255,6 +1308,8 @@ function gumae2baesong(f)
f.od_b_zip2.value = f.od_zip2.value;
f.od_b_addr1.value = f.od_addr1.value;
f.od_b_addr2.value = f.od_addr2.value;
calculate_sendcost(String(f.od_b_zip1.value) + String(f.od_b_zip2.value));
}
</script>

View File

@ -64,6 +64,7 @@ if ($error != "")
$i_amount = (int)$_POST['od_amount'];
$i_send_cost = (int)$_POST['od_send_cost'];
$i_send_cost2 = (int)$_POST['od_send_cost2'];
$i_temp_point = (int)$_POST['od_temp_point'];
@ -251,6 +252,17 @@ if ((int)($send_cost - $tot_sc_cp_amount) !== $i_send_cost) {
die("Error..");
}
// 추가배송비가 상이함
$zipcode = $od_b_zip1 . $od_b_zip2;
$sql = " select sc_id, sc_amount from {$g4['shop_sendcost_table']} where sc_zip1 <= '$zipcode' and sc_zip2 >= '$zipcode' ";
$tmp = sql_fetch($sql);
if(!$tmp['sc_id'])
$send_cost2 = 0;
else
$send_cost2 = (int)$tmp['sc_amount'];
if($send_cost2 !== $i_send_cost2)
die("Error...");
// 결제포인트가 상이함
$tot_amount = $tot_sell_amount + $send_cost;
// 회원이면서 포인트사용이면
@ -271,7 +283,7 @@ if($default['de_mileage_use']) {
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0))
die("Error...");
die("Error....");
if ($od_temp_point)
{
@ -294,7 +306,7 @@ if($default['de_mileage_use']) {
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error...");
die("Error....");
if ($od_temp_point)
{
@ -303,7 +315,7 @@ if($default['de_mileage_use']) {
}
}
$i_amount = $i_amount + $i_send_cost - $i_temp_point;
$i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point;
if ($od_settle_case == "무통장")
{
@ -425,6 +437,7 @@ $sql = " insert {$g4['shop_order_table']}
od_memo = '$od_memo',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_amount',
od_temp_amount = '$od_temp_amount',
od_temp_point = '$od_temp_point',

View File

@ -116,6 +116,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
}
$send_cost = $od['od_send_cost'];
$send_cost2 = $od['od_send_cost2'];
$send_coupon = $od['od_send_coupon'];
$org_send_cost = $send_cost + $send_coupon;
?>
@ -124,7 +125,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인
$od_coupon = $od['od_coupon'];
$tot_amount = $tot_sell_amount + $send_cost - $tot_cp_amount - $od_coupon;
$tot_amount = $tot_sell_amount + $send_cost + $send_cost2 - $tot_cp_amount - $od_coupon;
?>
<dl id="sod_bsk_tot">
@ -151,6 +152,11 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_coupon); ?> 원</strong></dd>
<?php } ?>
<?php if ($org_send_cost2 > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($org_send_cost2); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원</strong></dd>

View File

@ -65,6 +65,13 @@ $ft_a_st = 'display:block;padding:30px 0;background:#484848;color:#fff;text-alig
</tr>
<?php } ?>
<?php if ($od_send_cost2 > 0) { // 추가배송비가 있다면 ?>
<tr>
<th scope="row" style="<?php echo $th_st; ?>">추가배송비</th>
<td style="<?php echo $td_st; ?>"><?php echo display_price($od_send_cost2); ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row" style="<?php echo $th_st; ?>">주문합계</th>
<td style="<?php echo $td_st; ?>"><?php echo display_price($ttotal_amount); ?></td>

View File

@ -65,6 +65,13 @@ $ft_a_st = 'display:block;padding:30px 0;background:#484848;color:#fff;text-alig
</tr>
<?php } ?>
<?php if ($od_send_cost2 > 0) { // 추가배송비가 있다면 ?>
<tr>
<th scope="row" style="<?php echo $th_st; ?>">추가배송비</th>
<td style="<?php echo $td_st; ?>"><?php echo display_price($od_send_cost2); ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row" style="<?php echo $th_st; ?>">주문합계</th>
<td style="<?php echo $td_st; ?>"><?php echo display_price($ttotal_amount); ?></td>

View File

@ -299,6 +299,8 @@ setTimeout("init_pay_button();",300);
<input type="hidden" name="org_od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="org_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="od_send_cost2" value="0">
<input type="hidden" name="item_coupon" value="0">
<?php
/* ============================================================================== */
@ -699,6 +701,10 @@ setTimeout("init_pay_button();",300);
<th>총 주문금액</th>
<td><span id="od_tot_amount"><?php echo number_format($tot_amount); ?></span>원</td>
</tr>
<tr>
<th>추가배송비</th>
<td><span id="od_send_cost2">0</span>원 (지역에 따라 추가되는 도선료 등의 배송비입니다.)</td>
</tr>
</tbody>
</table>
@ -905,6 +911,7 @@ setTimeout("init_pay_button();",300);
$(function() {
var $cp_btn_el;
var $cp_row_el;
var zipcode = "";
$(".it_coupon_btn").click(function() {
$cp_btn_el = $(this);
@ -1006,6 +1013,7 @@ $(function() {
var subj = $el.find("input[name='o_cp_subj[]']").val();
var od_amount = parseInt($("input[name=org_od_amount]").val());
var send_cost = $("input[name=org_send_cost]").val();
var item_coupon = parseInt($("input[name=item_coupon]").val());
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
@ -1015,8 +1023,10 @@ $(function() {
$("input[name=od_send_cost]").val(send_cost);
$("input[name=sc_cp_id]").val("");
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
$("input[name=od_amount]").val(od_amount - amount);
$("input[name=od_amount]").val(od_amount - item_coupon - amount);
$("input[name=od_cp_id]").val(cp_id);
calculate_order_amount();
$("#od_coupon_frm").remove();
@ -1032,11 +1042,16 @@ $(function() {
$("#od_coupon_cancel").live("click", function() {
var org_amount = $("input[name=org_od_amount]").val();
$("input[name=od_amount]").val(org_amount);
var item_coupon = parseInt($("input[name=item_coupon]").val());
$("input[name=od_amount]").val(org_amount - item_coupon);
$("input[name=od_send_cost]").val($("input[name=org_send_cost]").val());
$("input[name=sc_cp_id]").val("");
calculate_order_amount();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").text("쿠폰적용").focus();
$(this).remove();
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
});
$("#sc_coupon_btn").click(function() {
@ -1089,6 +1104,21 @@ $(function() {
$(this).remove();
});
$("#od_b_addr2").focus(function() {
var zip1 = $("#od_b_zip1").val().replace(/[^0-9]/g, "");
var zip2 = $("#od_b_zip2").val().replace(/[^0-9]/g, "");
if(zip1 == "" || zip2 == "")
return false;
var code = String(zip1) + String(zip2);
if(zipcode == code)
return false;
zipcode = code;
calculate_sendcost(code);
});
$("#od_settle_bank").bind("click", function() {
$("[name=od_deposit_name]").val( $("[name=od_b_name]").val() );
$("#settle_bank").show();
@ -1131,14 +1161,22 @@ function calculate_total_amount()
$("#ct_tot_amount").text(number_format(String(tot_sell_amount))+" 원");
$("input[name=good_mny]").val(tot_sell_amount);
$("input[name=od_amount]").val(sell_amount);
$("input[name=org_od_amount]").val(sell_amount);
$("input[name=od_amount]").val(sell_amount - tot_cp_amount);
$("input[name=od_send_cost]").val(send_cost);
<?php if($od_cnt > 0) { ?>
$("input[name=item_coupon]").val(tot_cp_amount);
<?php if($oc_cnt > 0) { ?>
$("input[name=od_cp_id]").val("");
if($("#od_coupon_cancel").size()) {
$("#od_coupon_btn").text("쿠폰적용");
$("#od_coupon_cancel").remove();
}
<?php } ?>
<?php if($sc_cnt > 0) { ?>
$("input[name=sc_cp_id]").val("");
if($("#sc_coupon_cancel").size()) {
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
}
<?php } ?>
$("input[name=od_temp_point]").val(0);
<?php if($temp_point > 0 && $is_member) { ?>
@ -1151,7 +1189,8 @@ function calculate_order_amount()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var tot_amount = sell_amount + send_cost;
var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
var tot_amount = sell_amount + send_cost + send_cost2;
$("input[name=good_mny]").val(tot_amount);
$("#od_tot_amount").text(number_format(String(tot_amount)));
@ -1182,6 +1221,20 @@ function calculate_temp_point()
$("input[name=max_temp_point]").val(temp_point);
}
function calculate_sendcost(code)
{
$.post(
"./ordersendcost.php",
{ zipcode: code },
function(data) {
$("input[name=od_send_cost2]").val(data);
$("#od_send_cost2").text(number_format(String(data)));
calculate_order_amount();
}
);
}
function forderform_check(f)
{
errmsg = "";
@ -1394,6 +1447,8 @@ function gumae2baesong(f)
f.od_b_zip2.value = f.od_zip2.value;
f.od_b_addr1.value = f.od_addr1.value;
f.od_b_addr2.value = f.od_addr2.value;
calculate_sendcost(String(f.od_b_zip1.value) + String(f.od_b_zip2.value));
}
</script>

View File

@ -58,6 +58,7 @@ if ($error != "")
$i_amount = (int)$_POST['od_amount'];
$i_send_cost = (int)$_POST['od_send_cost'];
$i_send_cost2 = (int)$_POST['od_send_cost2'];
$i_temp_point = (int)$_POST['od_temp_point'];
@ -245,6 +246,17 @@ if ((int)($send_cost - $tot_sc_cp_amount) !== $i_send_cost) {
die("Error..");
}
// 추가배송비가 상이함
$zipcode = $od_b_zip1 . $od_b_zip2;
$sql = " select sc_id, sc_amount from {$g4['shop_sendcost_table']} where sc_zip1 <= '$zipcode' and sc_zip2 >= '$zipcode' ";
$tmp = sql_fetch($sql);
if(!$tmp['sc_id'])
$send_cost2 = 0;
else
$send_cost2 = (int)$tmp['sc_amount'];
if($send_cost2 !== $i_send_cost2)
die("Error...");
// 결제포인트가 상이함
$tot_amount = $tot_od_amount + ($send_cost - $tot_sc_cp_amount);
// 회원이면서 포인트사용이면
@ -265,7 +277,7 @@ if($default['de_mileage_use']) {
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0))
die("Error...");
die("Error....");
if ($od_temp_point)
{
@ -288,7 +300,7 @@ if($default['de_mileage_use']) {
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error...");
die("Error....");
if ($od_temp_point)
{
@ -297,7 +309,7 @@ if($default['de_mileage_use']) {
}
}
$i_amount = $i_amount + $i_send_cost - $i_temp_point;
$i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point;
if ($od_settle_case == "무통장")
{
@ -419,6 +431,7 @@ $sql = " insert {$g4['shop_order_table']}
od_memo = '$od_memo',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_amount',
od_temp_amount = '$od_temp_amount',
od_temp_point = '$od_temp_point',

View File

@ -128,6 +128,7 @@ if(openwin != null) {
}
$send_cost = $od['od_send_cost'];
$send_cost2 = $od['od_send_cost2'];
$send_coupon = $od['od_send_coupon'];
$org_send_cost = $send_cost + $send_coupon;
?>
@ -136,7 +137,7 @@ if(openwin != null) {
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인
$od_coupon = $od['od_coupon'];
$tot_amount = $tot_sell_amount + $send_cost - $tot_cp_amount - $od_coupon;
$tot_amount = $tot_sell_amount + $send_cost + $send_cost2 - $tot_cp_amount - $od_coupon;
?>
<dl id="sod_bsk_tot">
@ -163,6 +164,11 @@ if(openwin != null) {
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_coupon); ?> 원</strong></dd>
<?php } ?>
<?php if ($send_cost2 > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost2); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원</strong></dd>

View File

@ -71,4 +71,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
// 배송비가 있다면 총계에 더한다
if ($od_send_cost)
$ttotal_amount += $od_send_cost;
// 추가배송비가 있다면 총계에 더한다
if ($od_send_cost2)
$ttotal_amount += $od_send_cost2;
?>

19
shop/ordersendcost.php Normal file
View File

@ -0,0 +1,19 @@
<?php
include_once('./_common.php');
$code = $_POST['zipcode'];
if(!$code)
die('0');
$sql = " select sc_id, sc_amount
from {$g4['shop_sendcost_table']}
where sc_zip1 <= $code
and sc_zip2 >= $code ";
$row = sql_fetch($sql);
if(!$row['sc_id'])
die('0');
die($row['sc_amount']);
?>