diff --git a/adm/shop_admin/configform.php b/adm/shop_admin/configform.php
index 0364637bf..a9eebd5c5 100644
--- a/adm/shop_admin/configform.php
+++ b/adm/shop_admin/configform.php
@@ -856,6 +856,20 @@ $pg_anchor = '
안내메세지 출력 사용
+
+ |
+
+
+ 일
+ |
+
+
+ |
+
+
+ > 사용
+ |
+
비회원에 대한 개인정보수집 내용 |
|
diff --git a/adm/shop_admin/configformupdate.php b/adm/shop_admin/configformupdate.php
index 4fc4e86a6..45669528c 100644
--- a/adm/shop_admin/configformupdate.php
+++ b/adm/shop_admin/configformupdate.php
@@ -148,6 +148,8 @@ $sql = " update {$g4['shop_default_table']}
de_sms_hp = '$de_sms_hp',
de_item_ps_use = '$de_item_ps_use',
de_code_dup_use = '$de_code_dup_use',
+ de_cart_keep_term = '$de_cart_keep_term',
+ de_guest_cart_use = '$de_guest_cart_use',
de_point_per = '$de_point_per',
de_admin_buga_no = '$de_admin_buga_no',
de_different_msg = '$de_different_msg',
diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php
index c37ce5976..a1a622b2b 100644
--- a/adm/shop_admin/orderform.php
+++ b/adm/shop_admin/orderform.php
@@ -21,12 +21,11 @@ include_once(G4_ADMIN_PATH.'/admin.head.php');
//------------------------------------------------------------------------------
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
//------------------------------------------------------------------------------
-if (!isset($cart_not_delete)) {
- if (!$hours) $hours = 6;
- $beforehours = date("Y-m-d H:i:s", ( G4_SERVER_TIME - (60 * 60 * $hours) ) );
- $sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforehours' ";
- sql_query($sql);
-}
+$keep_term = $default['de_cart_keep_term'];
+if (!$keep_term) $keep_term = 15; // 기본값 15일
+$beforetime = date('Y-m-d H:i:s', ( G4_SERVER_TIME - (86400 * $keep_term) ) );
+$sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforetime' ";
+sql_query($sql);
//------------------------------------------------------------------------------
diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php
index 851b4099d..71f3edacd 100644
--- a/extend/shop.extend2.php
+++ b/extend/shop.extend2.php
@@ -84,14 +84,6 @@ if(!$result) {
ADD `ct_num` INT(11) NOT NULL DEFAULT '0' AFTER `ct_qty` ", false);
}
-// ct_order 추가
-$sql = " select ct_order from {$g4['shop_cart_table']} limit 1 ";
-$result = sql_query($sql, false);
-if(!$result) {
- sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
- ADD `ct_order` INT(11) NOT NULL DEFAULT '0' AFTER `ct_direct` ", false);
-}
-
// it_brand 추가
$sql = " select it_brand from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
@@ -196,4 +188,15 @@ if (!isset($it['it_mobile_explan'])) {
ADD `it_mobile_head_html` TEXT NOT NULL AFTER `it_tail_html`,
ADD `it_mobile_tail_html` TEXT NOT NULL AFTER `it_mobile_head_html` ", false);
}
+
+// de_guest_cart_use 필드추가
+$sql = " select de_guest_cart_use from {$g4['shop_default_table']} ";
+$result = sql_query($sql, false);
+if(!$result) {
+ sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
+ ADD `mb_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `uq_id` ", false);
+ sql_query(" ALTER TABLE `{$g4['shop_default_table']}`
+ ADD `de_cart_keep_term` INT(11) NOT NULL DEFAULT '0' AFTER `de_code_dup_use`,
+ ADD `de_guest_cart_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_cart_keep_term` ", false);
+}
?>
\ No newline at end of file
diff --git a/install/install_db.php b/install/install_db.php
index 419f1fa9d..16dbaac96 100644
--- a/install/install_db.php
+++ b/install/install_db.php
@@ -263,6 +263,7 @@ if($shop_install) {
de_card_use = '0',
de_card_max_amount = '1000',
de_point_settle = '10000',
+ de_cart_keep_term = '15',
de_point_per = '5',
de_card_point = '0',
de_point_days = '7',
diff --git a/install/shop.sql b/install/shop.sql
index 5617ad587..9c7037d30 100644
--- a/install/shop.sql
+++ b/install/shop.sql
@@ -56,6 +56,7 @@ DROP TABLE IF EXISTS `shop_cart`;
CREATE TABLE IF NOT EXISTS `shop_cart` (
`ct_id` int(11) NOT NULL AUTO_INCREMENT,
`uq_id` bigint(20) unsigned NOT NULL,
+ `mb_id` varchar(255) NOT NULL DEFAULT '',
`it_id` varchar(20) NOT NULL DEFAULT '',
`it_name` varchar(255) NOT NULL DEFAULT '',
`ct_status` enum('쇼핑','주문','준비','배송','완료','취소','반품','품절') NOT NULL DEFAULT '쇼핑',
@@ -248,6 +249,8 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_ps_use` tinyint(4) NOT NULL DEFAULT '0',
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
+ `de_cart_keep_term` int(11) NOT NULL DEFAULT '0',
+ `de_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
`de_point_per` tinyint(4) NOT NULL DEFAULT '0',
`de_admin_buga_no` varchar(255) NOT NULL DEFAULT '',
`de_different_msg` tinyint(4) NOT NULL DEFAULT '0',
diff --git a/mobile/shop/cartsub.inc.php b/mobile/shop/cartsub.inc.php
index 122f4edc0..76ac281b6 100644
--- a/mobile/shop/cartsub.inc.php
+++ b/mobile/shop/cartsub.inc.php
@@ -56,7 +56,7 @@ $sql = " select a.ct_id,
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0'
- order by a.ct_order, a.ct_id ";
+ order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
diff --git a/mobile/shop/orderinquiry.sub.php b/mobile/shop/orderinquiry.sub.php
index f9d583859..89f4c097f 100644
--- a/mobile/shop/orderinquiry.sub.php
+++ b/mobile/shop/orderinquiry.sub.php
@@ -21,7 +21,7 @@ $sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
- where mb_id = '{$member['mb_id']}'
+ where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc
$limit ";
diff --git a/shop/cart.php b/shop/cart.php
index 37d5c70d7..6e3c559e4 100644
--- a/shop/cart.php
+++ b/shop/cart.php
@@ -1,6 +1,23 @@
'$ctime' ";
+ sql_query($sql);
+}
+
if (G4_IS_MOBILE) {
include_once(G4_MSHOP_PATH.'/cart.php');
return;
diff --git a/shop/cartsub.inc.php b/shop/cartsub.inc.php
index 6818bdca3..a53865dc1 100644
--- a/shop/cartsub.inc.php
+++ b/shop/cartsub.inc.php
@@ -55,7 +55,7 @@ $sql = " select a.ct_id,
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
and a.ct_num = '0'
- order by a.ct_order, a.ct_id ";
+ order by a.ct_id ";
$result = sql_query($sql);
$good_info = '';
diff --git a/shop/cartupdate.php b/shop/cartupdate.php
index 45d5f7bdf..a56d078a9 100644
--- a/shop/cartupdate.php
+++ b/shop/cartupdate.php
@@ -1,6 +1,21 @@