diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 1799eee87..4ca7e00c5 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -1123,6 +1123,7 @@ function calculate_total_price() $("input[name=od_send_coupon]").val(0); 0) { ?> $("input[name=od_cp_id]").val(""); + $("#od_cp_price").text(0); if($("#od_coupon_cancel").size()) { $("#od_coupon_btn").text("쿠폰적용"); $("#od_coupon_cancel").remove(); @@ -1130,6 +1131,7 @@ function calculate_total_price() 0) { ?> $("input[name=sc_cp_id]").val(""); + $("#sc_cp_price").text(0); if($("#sc_coupon_cancel").size()) { $("#sc_coupon_btn").text("쿠폰적용"); $("#sc_coupon_cancel").remove(); @@ -1147,7 +1149,7 @@ function calculate_order_price() var sell_price = parseInt($("input[name=od_price]").val()); var send_cost = parseInt($("input[name=od_send_cost]").val()); var send_cost2 = parseInt($("input[name=od_send_cost2]").val()); - var send_coupon = parseInt($("input[name=od_send_coupon").val()); + var send_coupon = parseInt($("input[name=od_send_coupon]").val()); var tot_price = sell_price + send_cost + send_cost2 - send_coupon; $("form[name=sm_form] input[name=good_mny]").val(tot_price); diff --git a/mobile/shop/orderformupdate.php b/mobile/shop/orderformupdate.php index 825ac0b1d..1a3dfd8de 100644 --- a/mobile/shop/orderformupdate.php +++ b/mobile/shop/orderformupdate.php @@ -482,13 +482,15 @@ if($is_member) { $cp_it_id = $_POST['it_id'][$i]; $cp_prc = (int)$arr_it_cp_prc[$cp_it_id]; - $sql = " insert into {$g4['shop_coupon_log_table']} - set cp_id = '$cid', - mb_id = '{$member['mb_id']}', - od_id = '$od_id', - cp_price = '$cp_prc', - cl_datetime = '".G4_TIME_YMDHIS."' "; - sql_query($sql); + if(trim($cid)) { + $sql = " insert into {$g4['shop_coupon_log_table']} + set cp_id = '$cid', + mb_id = '{$member['mb_id']}', + od_id = '$od_id', + cp_price = '$cp_prc', + cl_datetime = '".G4_TIME_YMDHIS."' "; + sql_query($sql); + } // 쿠폰사용금액 cart에 기록 $cp_prc = (int)$arr_it_cp_prc[$cp_it_id]; diff --git a/shop/orderform.php b/shop/orderform.php index 17dd6e0ed..9e0a2816a 100644 --- a/shop/orderform.php +++ b/shop/orderform.php @@ -1340,6 +1340,7 @@ function calculate_total_price() $("input[name=od_send_coupon]").val(0); 0) { ?> $("input[name=od_cp_id]").val(""); + $("#od_cp_price").text(0); if($("#od_coupon_cancel").size()) { $("#od_coupon_btn").text("쿠폰적용"); $("#od_coupon_cancel").remove(); @@ -1347,6 +1348,7 @@ function calculate_total_price() 0) { ?> $("input[name=sc_cp_id]").val(""); + $("#sc_cp_price").text(0); if($("#sc_coupon_cancel").size()) { $("#sc_coupon_btn").text("쿠폰적용"); $("#sc_coupon_cancel").remove(); @@ -1364,7 +1366,7 @@ function calculate_order_price() var sell_price = parseInt($("input[name=od_price]").val()); var send_cost = parseInt($("input[name=od_send_cost]").val()); var send_cost2 = parseInt($("input[name=od_send_cost2]").val()); - var send_coupon = parseInt($("input[name=od_send_coupon").val()); + var send_coupon = parseInt($("input[name=od_send_coupon]").val()); var tot_price = sell_price + send_cost + send_cost2 - send_coupon; $("input[name=good_mny]").val(tot_price); diff --git a/shop/orderformupdate.php b/shop/orderformupdate.php index 9cdc9c9b5..df2862996 100644 --- a/shop/orderformupdate.php +++ b/shop/orderformupdate.php @@ -477,13 +477,15 @@ if($is_member) { $cp_it_id = $_POST['it_id'][$i]; $cp_prc = (int)$arr_it_cp_prc[$cp_it_id]; - $sql = " insert into {$g4['shop_coupon_log_table']} - set cp_id = '$cid', - mb_id = '{$member['mb_id']}', - od_id = '$od_id', - cp_price = '$cp_prc', - cl_datetime = '".G4_TIME_YMDHIS."' "; - sql_query($sql); + if(trim($cid)) { + $sql = " insert into {$g4['shop_coupon_log_table']} + set cp_id = '$cid', + mb_id = '{$member['mb_id']}', + od_id = '$od_id', + cp_price = '$cp_prc', + cl_datetime = '".G4_TIME_YMDHIS."' "; + sql_query($sql); + } // 쿠폰사용금액 cart에 기록 $cp_prc = (int)$arr_it_cp_prc[$cp_it_id];