From 153b19b1f815aa3bc45e612ca45f271ebe9e7fd0 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 9 Dec 2013 11:39:16 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=ED=92=88=EA=B8=88=EC=95=A1=EC=9D=B4?= =?UTF-8?q?=200=EC=9B=90=EC=9D=BC=20=EB=95=8C=20=EC=BF=A0=ED=8F=B0=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EC=98=A4=EB=A5=98=20=EC=95=88=EB=82=B4=20?= =?UTF-8?q?=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 --- mobile/shop/orderform.php | 4 ++++ shop/ordercoupon.php | 5 ++++- shop/orderform.php | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 5d0f4eb58..11ebff5cb 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -909,6 +909,10 @@ $(function() { $("#od_coupon_frm").remove(); var $this = $(this); var price = parseInt($("input[name=org_od_price]").val()) - parseInt($("input[name=item_coupon]").val()); + if(price <= 0) { + alert('상품금액이 0원이므로 쿠폰을 사용할 수 없습니다.'); + return false; + } $.post( "./ordercoupon.php", { price: price }, diff --git a/shop/ordercoupon.php b/shop/ordercoupon.php index 2a24a1e33..c64a27a18 100644 --- a/shop/ordercoupon.php +++ b/shop/ordercoupon.php @@ -4,7 +4,10 @@ include_once('./_common.php'); if($is_guest) exit; -$price = $_POST['price']; +$price = (int)$_POST['price']; + +if($price <= 0) + echo '상품금액이 0원이므로 쿠폰을 사용할 수 없습니다.'; // 쿠폰정보 $sql = " select * diff --git a/shop/orderform.php b/shop/orderform.php index 1e736968e..cc3f2c47b 100644 --- a/shop/orderform.php +++ b/shop/orderform.php @@ -1172,6 +1172,10 @@ $(function() { $("#od_coupon_frm").remove(); var $this = $(this); var price = parseInt($("input[name=org_od_price]").val()) - parseInt($("input[name=item_coupon]").val()); + if(price <= 0) { + alert('상품금액이 0원이므로 쿠폰을 사용할 수 없습니다.'); + return false; + } $.post( "./ordercoupon.php", { price: price },