옵션기능 변경에 따른 장바구니 재고 체크 코드 수정

This commit is contained in:
chicpro
2013-05-24 18:16:45 +09:00
parent 7e0961564f
commit c9007b4749
2 changed files with 34 additions and 20 deletions

View File

@ -157,6 +157,29 @@ function get_it_stock_qty($it_id)
$sql = " select SUM(ct_qty) as sum_qty
from {$g4['shop_cart_table']}
where it_id = '$it_id'
and io_id = ''
and ct_stock_use = 0
and ct_status in ('주문', '준비') ";
$row = sql_fetch($sql);
$daegi = (int)$row['sum_qty'];
return $jaego - $daegi;
}
// 옵션의 재고 (창고재고수량 - 주문대기수량)
function get_option_stock_qty($it_id, $io_id)
{
global $g4;
$sql = " select io_stock_qty from {$g4['shop_item_option_table']} where it_id = '$it_id' and io_id = '$io_id' and io_use = '1' ";
$row = sql_fetch($sql);
$jaego = (int)$row['it_stock_qty'];
// 재고에서 빼지 않았고 주문인것만
$sql = " select SUM(ct_qty) as sum_qty
from {$g4['shop_cart_table']}
where it_id = '$it_id'
and io_id = '$io_id'
and ct_stock_use = 0
and ct_status in ('주문', '준비') ";
$row = sql_fetch($sql);