From a21e7acaaf1e80091bc54beec3c2bcd027025fa0 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 24 May 2013 11:39:37 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EB=9F=89=EC=A6=9D=EA=B0=80=EC=8B=9C?= =?UTF-8?q?=20=EC=98=B5=EC=85=98=EC=9D=98=20=EC=9E=AC=EA=B3=A0=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=20=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/item.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shop/item.php b/shop/item.php index 0dbe9da83..45b585542 100644 --- a/shop/item.php +++ b/shop/item.php @@ -484,14 +484,21 @@ else var mode = $(this).text(); var this_qty, max_qty = 9999, min_qty = 1; var $el_qty = $(this).closest("li").find("input[name='ct_qty[]']"); + var stock = parseInt($(this).closest("li").find("input[name='io_stock[]']").val()); switch(mode) { case "증가": this_qty = parseInt($el_qty.val().replace(/[^0-9]/, "")) + 1; + if(this_qty > stock) { + alert("재고수량 보다 많은 수량을 구매할 수 없습니다."); + this_qty = stock; + } + if(this_qty > max_qty) { this_qty = max_qty; alert("최대 구매수량은 "+number_format(String(max_qty))+" 입니다."); } + $el_qty.val(this_qty); price_calculate(); break;