From 14af11d0fac73096c6744a1dad113e2cdc6ecacc Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 11 Jul 2023 11:17:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=9E=AC=EA=B3=A0=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=EC=97=90=20=EC=83=81=ED=92=88=20=EC=9E=AC?= =?UTF-8?q?=EA=B3=A0=EB=A5=BC=20=EC=B2=B4=ED=81=AC=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shop.lib.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index fb0b0b033..4cc597663 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -1943,8 +1943,9 @@ function is_soldout($it_id, $is_cache=false) // 상품정보 $it = get_shop_item($it_id, $is_cache); - if($it['it_soldout'] || $it['it_stock_qty'] <= 0) + if ($it['it_soldout']) { return true; + } $count = 0; $soldout = false; @@ -1953,7 +1954,7 @@ function is_soldout($it_id, $is_cache=false) $sql = " select count(*) as cnt from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' and io_type = '0' "; $row = sql_fetch($sql); - if($row['cnt']) { + if (isset($row['cnt']) && $row['cnt']) { $sql = " select io_id, io_type, io_stock_qty from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' @@ -1972,12 +1973,18 @@ function is_soldout($it_id, $is_cache=false) // 모든 선택옵션 품절이면 상품 품절 if($i == $count) $soldout = true; - } else { - // 상품 재고수량 - $stock_qty = get_it_stock_qty($it_id); - if($stock_qty <= 0) + } else { + + if ($it['it_stock_qty'] <= 0) { $soldout = true; + } else { + // 상품 재고수량 + $stock_qty = get_it_stock_qty($it_id); + + if($stock_qty <= 0) + $soldout = true; + } } $cache[$key] = $soldout;