diff --git a/shop/orderaddress.php b/shop/orderaddress.php index 04f0edec9..8e984cf6f 100644 --- a/shop/orderaddress.php +++ b/shop/orderaddress.php @@ -26,7 +26,7 @@ $sql = " select * where mb_id = '{$member['mb_id']}' order by ad_default desc, - ad_id desc + ad_id desc limit $from_record, $rows"; $result = sql_query($sql); @@ -45,7 +45,7 @@ if (G5_IS_MOBILE) { $g5['title'] = '배송지 목록'; include_once(G5_PATH.'/head.sub.php'); -$order_action_url = G5_HTTPS_SHOP_URL.'/orderaddress_update.php'; +$order_action_url = G5_HTTPS_SHOP_URL.'/orderaddressupdate.php'; ?>
@@ -77,10 +77,10 @@ $order_action_url = G5_HTTPS_SHOP_URL.'/orderaddress_update.php'; ?> - + - + >
@@ -139,16 +139,16 @@ $(function() { }); // 전체선택 부분 - $("#chk_all").on("change", function() { - if ($(this).attr("checked")){ - $("input[type='checkbox']:not(checked)").attr("checked", true); - }else{ - $("input[type='checkbox']:checked").attr("checked", false); + $("#chk_all").on("click", function() { + if($(this).is(":checked")) { + $("input[name^='chk[']").attr("checked", true); + } else { + $("input[name^='chk[']").attr("checked", false); } }); $("#btn_submit").on("click", function() { - if( $(":checkbox:checked").length==0 ){ + if($("input[name^='chk[']:checked").length==0 ){ alert("수정하실 항목을 하나 이상 선택하세요."); return false; } diff --git a/shop/orderaddressupdate.php b/shop/orderaddressupdate.php index 645fdfdd4..607d22618 100644 --- a/shop/orderaddressupdate.php +++ b/shop/orderaddressupdate.php @@ -1,47 +1,36 @@ \ No newline at end of file diff --git a/shop/orderform.php b/shop/orderform.php index dadc5adf5..180d33ac4 100644 --- a/shop/orderform.php +++ b/shop/orderform.php @@ -293,7 +293,7 @@ function get_intall_file() alert('장바구니가 비어 있습니다.', G5_SHOP_URL.'/cart.php'); } else { // 배송비 계산 - $send_cost = get_sendcost($tot_sell_price, $s_cart_id); + $send_cost = get_sendcost($s_cart_id); } // 복합과세처리 @@ -664,7 +664,7 @@ function get_intall_file() $sep = chr(30); // 주문자와 동일 - $addr_list .= ''.PHP_EOL; + $addr_list .= ''.PHP_EOL; $addr_list .= ''.PHP_EOL; // 기본배송지 @@ -683,6 +683,7 @@ function get_intall_file() $sql = " select * from {$g5['g5_shop_order_address_table']} where mb_id = '{$member['mb_id']}' + and ad_default = '0' order by ad_id desc limit 2 "; $result = sql_query($sql); @@ -1264,8 +1265,10 @@ $(function() { // 배송지선택 $("input[name=ad_sel_addr]").on("click", function() { var addr = $(this).val().split(String.fromCharCode(30)); - if ($(this).attr("id") == "ad_sel_addr_same"); // 이 아이디가 ad_sel_addr_same 일때는 아무런 실행도 하지 않는다. - else{ // 아닐땐 실행 + + if (addr[0] == "same") { + gumae2baesong(); + } else { if(addr[0] == "new") { for(i=0; i<8; i++) { addr[i] = ""; @@ -1659,7 +1662,7 @@ function forderform_check(f) } // 구매자 정보와 동일합니다. -$("#ad_sel_addr_same").on("click", function(){ +function gumae2baesong() { var f = document.forderform; f.od_b_name.value = f.od_name.value; @@ -1671,7 +1674,7 @@ $("#ad_sel_addr_same").on("click", function(){ f.od_b_addr2.value = f.od_addr2.value; calculate_sendcost(String(f.od_b_zip1.value) + String(f.od_b_zip2.value)); -}); +} // 구매자 정보와 동일 함수 끝 diff --git a/shop/orderformupdate.php b/shop/orderformupdate.php index a10880ffd..3f685c6d9 100644 --- a/shop/orderformupdate.php +++ b/shop/orderformupdate.php @@ -579,34 +579,30 @@ if (get_session('ss_direct')) if($is_member) { $sql = " select * from {$g5['g5_shop_order_address_table']} where mb_id = '{$member['mb_id']}' - and ad_name = '{$_POST['od_b_name']}' - and ad_tel = '{$_POST['od_b_tel']}' - and ad_hp = '{$_POST['od_b_hp']}' - and ad_zip1 = '{$_POST['od_b_zip1']}' - and ad_zip2 = '{$_POST['od_b_zip2']}' - and ad_addr1 = '{$_POST['od_b_addr1']}' - and ad_addr2 = '{$_POST['od_b_addr2']}' "; - + and ad_name = '$od_b_name' + and ad_tel = '$od_b_tel' + and ad_hp = '$od_b_hp' + and ad_zip1 = '$od_b_zip1' + and ad_zip2 = '$od_b_zip2' + and ad_addr1 = '$od_b_addr1' + and ad_addr2 = '$od_b_addr2' "; $row = sql_fetch($sql); - // 기본배송지로 할시 + // 기본배송지 체크 if($ad_default) { $sql = " update {$g5['g5_shop_order_address_table']} set ad_default = '0' where mb_id = '{$member['mb_id']}' "; sql_query($sql); - - if($row['ad_id']){ - $sql = " update {$g5['g5_shop_order_address_table']} - set ad_default = '1' - where mb_id = '{$member['mb_id']}' - and ad_id = '{$row['ad_id']}' "; - sql_query($sql); - } } - // 카운트 된 값이 없으면 새로 배송지 추가 저장 - if(!$row['ad_id']){ + if($row['ad_id']){ + $sql = " update {$g5['g5_shop_order_address_table']} + set ad_default = '1', + ad_subject = '$ad_subject' + where mb_id = '{$member['mb_id']}' + and ad_id = '{$row['ad_id']}' "; + } else { $sql = " insert into {$g5['g5_shop_order_address_table']} set mb_id = '{$member['mb_id']}', ad_subject = '$ad_subject', @@ -618,8 +614,9 @@ if($is_member) { ad_zip2 = '$od_b_zip2', ad_addr1 = '$od_b_addr1', ad_addr2 = '$od_b_addr2' "; - sql_query($sql); } + + sql_query($sql); } goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);