장바구니 담기 재고 체크를 기존 자료 삭제 후 하도록 위치변경

This commit is contained in:
chicpro
2014-05-21 15:42:08 +09:00
parent 5d07028aa4
commit 329ce1ed5a

View File

@ -141,6 +141,14 @@ else // 장바구니에 담기
$lst_count++;
}
// 바로구매에 있던 장바구니 자료를 지운다.
if($sw_direct)
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and ct_direct = 1 ", false);
// 옵션수정일 때 기존 장바구니 자료를 먼저 삭제
if($act == 'optionmod')
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and it_id = '$it_id' ");
//--------------------------------------------------------
// 재고 검사
//--------------------------------------------------------
@ -173,14 +181,6 @@ else // 장바구니에 담기
}
//--------------------------------------------------------
// 바로구매에 있던 장바구니 자료를 지운다.
if($i == 0)
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and ct_direct = 1 ", false);
// 옵션수정일 때 기존 장바구니 자료를 먼저 삭제
if($act == 'optionmod')
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and it_id = '$it_id' ");
// 장바구니에 Insert
// 바로구매일 경우 장바구니가 체크된것으로 강제 설정
if($sw_direct)