옵션 재고 체크시 타입도 넘기도록 수정
This commit is contained in:
@ -167,11 +167,13 @@ function get_it_stock_qty($it_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 옵션의 재고 (창고재고수량 - 주문대기수량)
|
// 옵션의 재고 (창고재고수량 - 주문대기수량)
|
||||||
function get_option_stock_qty($it_id, $io_id)
|
function get_option_stock_qty($it_id, $io_id, $type)
|
||||||
{
|
{
|
||||||
global $g4;
|
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' ";
|
$sql = " select io_stock_qty
|
||||||
|
from {$g4['shop_item_option_table']}
|
||||||
|
where it_id = '$it_id' and io_id = '$io_id' and io_type = '$type' and io_use = '1' ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
$jaego = (int)$row['io_stock_qty'];
|
$jaego = (int)$row['io_stock_qty'];
|
||||||
|
|
||||||
@ -180,6 +182,7 @@ function get_option_stock_qty($it_id, $io_id)
|
|||||||
from {$g4['shop_cart_table']}
|
from {$g4['shop_cart_table']}
|
||||||
where it_id = '$it_id'
|
where it_id = '$it_id'
|
||||||
and io_id = '$io_id'
|
and io_id = '$io_id'
|
||||||
|
and io_type = '$type'
|
||||||
and ct_stock_use = 0
|
and ct_stock_use = 0
|
||||||
and ct_status in ('주문', '준비') ";
|
and ct_status in ('주문', '준비') ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
|
|||||||
@ -197,7 +197,7 @@ else // 장바구니에 담기
|
|||||||
if(!$_POST['io_id'][$i])
|
if(!$_POST['io_id'][$i])
|
||||||
$it_stock_qty = get_it_stock_qty($_POST['it_id']);
|
$it_stock_qty = get_it_stock_qty($_POST['it_id']);
|
||||||
else
|
else
|
||||||
$it_stock_qty = get_option_stock_qty($_POST['it_id'], $_POST['io_id'][$i]);
|
$it_stock_qty = get_option_stock_qty($_POST['it_id'], $_POST['io_id'][$i], $_POST['io_type'][$i]);
|
||||||
|
|
||||||
if ($ct_qty + $sum_qty > $it_stock_qty)
|
if ($ct_qty + $sum_qty > $it_stock_qty)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user