#285 pc 배송지이력 추가

This commit is contained in:
chicpro
2013-09-03 18:22:26 +09:00
parent 742854e911
commit 52aae12d6d
5 changed files with 175 additions and 5 deletions

View File

@ -590,6 +590,49 @@ set_session('ss_order_id', '');
if (get_session('ss_direct'))
set_session('ss_cart_direct', '');
// 배송지처리
if($is_member && ($add_address || $ad_default)) {
$ad_hash = md5($od_b_zip1.$od_b_zip2.$od_b_addr1.$od_b_addr2);
$sql = " select ad_id
from {$g4['shop_order_address_table']}
where mb_id = '{$member['mb_id']}'
and ad_hash = '$ad_hash' ";
$row = sql_fetch($sql);
if($ad_default) {
$sql = " update {$g4['shop_order_address_table']}
set ad_default = '0'
where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
if($row['ad_id'] && $ad_default) {
$sql = " update {$g4['shop_order_address_table']}
set ad_default = '$ad_default' ";
if($ad_subject)
$sql .= " , ad_subject = '$ad_subject' ";
$sql .= " where ad_id = '{$row['ad_id']}'
and mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
if(!$row['ad_id'] && $add_address) {
$sql = " insert into {$g4['shop_order_address_table']}
set mb_id = '{$member['mb_id']}',
ad_subject = '$ad_subject',
ad_default = '$ad_default',
ad_name = '$od_b_name',
ad_tel = '$od_b_tel',
ad_hp = '$od_b_hp',
ad_zip1 = '$od_b_zip1',
ad_zip2 = '$od_b_zip2',
ad_addr1 = '$od_b_addr1',
ad_addr2 = '$od_b_addr2',
ad_hash = '$ad_hash' ";
sql_query($sql);
}
}
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);
?>