From 9a3691e2b581fef31603498b0a947b493db52bd4 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 26 Jun 2013 15:04:20 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B4=EA=B4=80=ED=95=A8=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=83=81=ED=92=88=EB=8B=B4=EA=B8=B0=EC=99=80=20=EC=A3=BC?= =?UTF-8?q?=EB=AC=B8=ED=95=98=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/shop/wishlist.php | 35 ++++++++++--------------- shop/cartupdate.php | 55 +++++++++++++++++++++++++++------------- shop/wishlist.php | 40 ++++++++++++----------------- 3 files changed, 67 insertions(+), 63 deletions(-) diff --git a/mobile/shop/wishlist.php b/mobile/shop/wishlist.php index 7dede73ed..892b4b8c4 100644 --- a/mobile/shop/wishlist.php +++ b/mobile/shop/wishlist.php @@ -10,7 +10,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
-
+ @@ -26,31 +26,25 @@ include_once(G4_MSHOP_PATH.'/_head.php'); @@ -73,7 +67,7 @@ include_once(G4_MSHOP_PATH.'/_head.php'); - + 삭제 @@ -86,11 +80,10 @@ include_once(G4_MSHOP_PATH.'/_head.php'); ?> -
- 장바구니 담기 - 주문하기 + +
@@ -125,7 +118,7 @@ include_once(G4_MSHOP_PATH.'/_head.php'); if(k == 0) { alert("상품을 하나 이상 체크 하십시오"); - return; + return false; } if (act == "direct_buy") @@ -137,9 +130,7 @@ include_once(G4_MSHOP_PATH.'/_head.php'); f.sw_direct.value = 0; } - f.action="/cartupdate.php"; - - f.submit(); + return true; } //--> diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 64b23c894..3cf26830c 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -72,9 +72,8 @@ else if ($act == "seldelete") // 선택삭제 } } } -else if ($act == "multi") // 온라인견적(등)에서 여러개의 상품이 한꺼번에 들어옴. +else if ($act == "multi") // 여러개의 상품이 한꺼번에 들어옴. { - // 보관함에서 금액이 제대로 반영되지 않던 오류를 수정 $fldcnt = count($_POST['it_name']); // 재고등을 검사 @@ -83,6 +82,11 @@ else if ($act == "multi") // 온라인견적(등)에서 여러개의 상품이 { if ($_POST['it_id'][$i] == "" || $_POST['ct_qty'][$i] <= 0) { continue; } + //옵션있는 상품은 건너뜀 + $sql = " select count(*) as cnt from {$g4['shop_item_option_table']} where it_id = '{$_POST['it_id'][$i]}' and io_type = '0' "; + $tmp = sql_fetch($sql); + if($tmp['cnt']) continue; + //-------------------------------------------------------- // 변조 검사 //-------------------------------------------------------- @@ -94,7 +98,7 @@ else if ($act == "multi") // 온라인견적(등)에서 여러개의 상품이 if ((int)$price !== (int)$_POST['it_price'][$i]) die("Error.."); - $point = $it['it_point']; + $point = get_item_point($it); // 포인트가 다름 if ((int)$point !== (int)$_POST['it_point'][$i] && $config['cf_use_point']) die("Error..."); @@ -115,6 +119,15 @@ else if ($act == "multi") // 온라인견적(등)에서 여러개의 상품이 // 오류가 있다면 오류메세지 출력 if ($error != "") { alert($error); } + $ct_count = 0; + $comma = ''; + $sql = " INSERT INTO {$g4['shop_cart_table']} + ( uq_id, mb_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_send_cost, ct_direct, ct_select ) + VALUES "; + $ct_select = 0; + if($sw_direct) + $ct_select = 1; + for ($i=0; $i<$fldcnt; $i++) { if ($_POST['it_id'][$i] == "" || $_POST['ct_qty'][$i] <= 0) continue; @@ -122,21 +135,29 @@ else if ($act == "multi") // 온라인견적(등)에서 여러개의 상품이 // 포인트 사용하지 않는다면 if (!$config['cf_use_point']) $_POST['it_point'][$i] = 0; - // 장바구니에 Insert - $sql = " insert {$g4['shop_cart_table']} - set uq_id = '$tmp_uq_id', - it_id = '{$_POST['it_id'][$i]}', - it_name = '{$_POST['it_name'][$i]}', - ct_status = '쇼핑', - ct_price = '{$_POST['it_price'][$i]}', - ct_point = '{$_POST['it_point'][$i]}', - ct_point_use = '0', - ct_stock_use = '0', - ct_qty = '{$_POST['ct_qty'][$i]}', - ct_time = '".G4_TIME_YMDHIS."', - ct_ip = '$REMOTE_ADDR' "; - sql_query($sql); + // 동일옵션의 상품이 있으면 수량 더함 + $sql2 = " select ct_id + from {$g4['shop_cart_table']} + where uq_id = '$tmp_uq_id' + and it_id = '{$_POST['it_id'][$i]}' + and ct_status = '쇼핑' "; + $row2 = sql_fetch($sql2); + if($row2['ct_id']) { + $sql3 = " update {$g4['shop_cart_table']} + set ct_qty = ct_qty + {$_POST['ct_qty'][$i]} + where ct_id = '{$row2['ct_id']}' "; + sql_query($sql3); + + continue; + } + + $sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id'][$i]}', '{$_POST['it_name'][$i]}', '쇼핑', '{$_POST['it_price'][$i]}', '{$_POST['it_point'][$i]}', '0', '0', '{$_POST['it_name'][$i]}', '{$_POST['ct_qty'][$i]}', '0', '', '0', '0', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )"; + $comma = ' , '; + $ct_count++; } + + if($ct_count > 0) + sql_query($sql); } else if ($act == "optionmod") // 장바구니에서 옵션변경 { diff --git a/shop/wishlist.php b/shop/wishlist.php index ebb1c43f9..300ab67a0 100644 --- a/shop/wishlist.php +++ b/shop/wishlist.php @@ -15,7 +15,7 @@ include_once('./_head.php');
-
+ @@ -32,31 +32,25 @@ include_once('./_head.php'); @@ -68,13 +62,13 @@ include_once('./_head.php'); { ?> 품절 - + - + - + @@ -90,12 +84,12 @@ include_once('./_head.php'); ?> -
- 장바구니 담기 - 주문하기 + +
+