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 },