diff --git a/shop/ajax.orderstock.php b/shop/ajax.orderstock.php index ff95b0ee1..bf5c66d7b 100644 --- a/shop/ajax.orderstock.php +++ b/shop/ajax.orderstock.php @@ -49,13 +49,28 @@ for($i=0; $row=sql_fetch_array($result); $i++) { $ct_qty = $row['ct_qty']; // 해당 상품이 품절 또는 판매중지 상태인지 체크합니다. - $sql = " select it_soldout, it_use from {$g5['g5_shop_item_table']} where it_id = '".$row['it_id']."' "; + $sql = " select it_soldout, it_use, ca_id, ca_id2, ca_id3 from {$g5['g5_shop_item_table']} where it_id = '".$row['it_id']."' "; $item = sql_fetch($sql); + + $category_str = ''; + + // 분류에서 판매가능한지 체크합니다. + if( $item['it_use'] && ($item['ca_id'] || $item['ca_id2'] || $item['ca_id3']) ){ + $sql = " select ca_use from {$g5['g5_shop_category_table']} where (ca_id = '".$item['ca_id']."' or ca_id = '".$item['ca_id2']."' or ca_id = '".$item['ca_id3']."') "; + $result2 = sql_query($sql); + + while($ca=sql_fetch_array($result2)){ + if ( ! $ca['ca_use']) { + $item['it_use'] = false; + $category_str = '분류에서 '; + } + } + } // 해당 상품이 품절 상태 또는 판매중지이면 if( $item['it_soldout'] || !$item['it_use'] ){ - $soldout_txt = $item['it_soldout'] ? '품절' : '판매중지'; + $soldout_txt = $item['it_soldout'] ? '품절' : $category_str.'판매중지'; $item_option = $row['it_name']; if($row['io_id']) $item_option .= '('.$row['ct_option'].')';