From 9533857eb9a155968ff13c5621c1ba95fc112a7d Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 24 May 2013 16:48:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=B5=EC=85=98=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EA=B0=80?= =?UTF-8?q?=EA=B2=A9=20=EB=B0=8F=20=EC=9E=AC=EA=B3=A0=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/cartupdate.php | 86 ++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 3db9459b6..d1ac9cdc6 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -142,41 +142,45 @@ else // 장바구니에 담기 if (!$_POST['it_id']) alert('장바구니에 담을 상품을 선택하여 주십시오.'); - if ($_POST['ct_qty'] < 1) - alert('수량은 1 이상 입력해 주십시오.'); + for($i=0; $i $it_stock_qty) - { - alert("$it_name 의 재고수량이 부족합니다.\\n\\n현재 재고수량 : " . number_format($it_stock_qty) . " 개"); + // 재고 구함 + $ct_qty = $_POST['ct_qty'][$i]; + if(!$_POST['io_id'][$i]) + $it_stock_qty = get_it_stock_qty($_POST['it_id']); + else + $it_stock_qty = get_option_stock_qty($_POST['io_id'][$i]); + + if ($ct_qty + $sum_qty > $it_stock_qty) + { + alert($_POST['io_value'][$i]." 의 재고수량이 부족합니다.\\n\\n현재 재고수량 : " . number_format($it_stock_qty) . " 개"); + } } //--------------------------------------------------------