From 6eaafefdbe99d93c3061658db8474180c7560e32 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 27 May 2013 18:28:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=B5=EC=85=98=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=A0=80=EC=9E=A5=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/cartupdate.php | 177 ++++++++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 207961a9b..6104d6617 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -129,98 +129,99 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경 if (!$_POST['it_id']) alert('장바구니에 담을 상품을 선택하여 주십시오.'); - if($_POST['io_type'][0] != 0) - alert('상품의 선택옵션을 선택해 주십시오.'); - - for($i=0; $i $it_stock_qty) - { - alert($_POST['io_value'][$i]." 의 재고수량이 부족합니다.\\n\\n현재 재고수량 : " . number_format($it_stock_qty) . " 개"); - } - } - //-------------------------------------------------------- - - // 바로구매에 있던 장바구니 자료를 지운다. - $result = sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_direct = 1 ", false); - if (!$result) { - // 삭제중 에러가 발생했다면 필드가 없다는 것이므로 바로구매 필드를 생성한다. - sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` ADD `ct_direct` TINYINT NOT NULL "); - } - // 기존 장바구니 자료를 먼저 삭제 sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and it_id = '$it_id' "); - // 포인트 사용하지 않는다면 - if (!$config['cf_use_point']) { $_POST['it_point'] = 0; } + $option_count = count($_POST['io_id']); - // 장바구니에 Insert - if(count($_POST['io_id'])) { + if($option_count) { + if($_POST['io_type'][0] != 0) + alert('상품의 선택옵션을 선택해 주십시오.'); + + for($i=0; $i $it_stock_qty) + { + alert($_POST['io_value'][$i]." 의 재고수량이 부족합니다.\\n\\n현재 재고수량 : " . number_format($it_stock_qty) . " 개"); + } + } + //-------------------------------------------------------- + + // 바로구매에 있던 장바구니 자료를 지운다. + $result = sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_direct = 1 ", false); + if (!$result) { + // 삭제중 에러가 발생했다면 필드가 없다는 것이므로 바로구매 필드를 생성한다. + sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` ADD `ct_direct` TINYINT NOT NULL "); + } + + // 포인트 사용하지 않는다면 + if (!$config['cf_use_point']) { $_POST['it_point'] = 0; } + + // 장바구니에 Insert $comma = ''; $sql = " INSERT INTO {$g4['shop_cart_table']} ( uq_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct )