From 6d0f782c0f911a93eea3fe7bfa807bcbc60d9947 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 17 Feb 2014 10:09:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B5=9C=EB=8C=80=EA=B5=AC=EB=A7=A4=EC=88=98?= =?UTF-8?q?=EB=9F=89=20=EC=84=A4=EC=A0=95=20=EB=95=8C=20=EC=9E=A5=EB=B0=94?= =?UTF-8?q?=EA=B5=AC=EB=8B=88=EC=97=90=20=EC=A4=91=EB=B3=B5=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=8B=B4=EA=B8=B0=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/cartupdate.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 39ec11f67..0f3556001 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -109,6 +109,20 @@ else // 장바구니에 담기 if($it['it_buy_max_qty'] > 0 && $sum_qty > $it['it_buy_max_qty']) alert($it['it_name'].'의 선택옵션 개수 총합 '.number_format($it['it_buy_max_qty']).'개 이하로 주문해 주십시오.'); + + // 기존에 장바구니에 담긴 상품이 있는 경우에 최대 구매수량 체크 + if($it['it_buy_max_qty'] > 0) { + $sql4 = " select count(*) as cnt + from {$g5['g5_shop_cart_table']} + where od_id = '$tmp_cart_id' + and it_id = '$it_id' + and io_type = '0' + and ct_status = '쇼핑' "; + $row4 = sql_fetch($sql4); + + if(($sum_qty + $row4['cnt']) > $it['it_buy_max_qty']) + alert($it['it_name'].'의 선택옵션 개수 총합 '.number_format($it['it_buy_max_qty']).'개 이하로 주문해 주십시오.', './cart.php'); + } } // 옵션정보를 얻어서 배열에 저장