#210 cart 테이블에 배송비와 지불형태 기록하도록 수정

This commit is contained in:
chicpro
2013-06-12 17:35:54 +09:00
parent 101ea0c39c
commit 7953c8f984
7 changed files with 39 additions and 66 deletions

View File

@ -294,4 +294,14 @@ if(!$result) {
ADD `it_sc_minimum` INT(11) NOT NULL DEFAULT '0' AFTER `it_sc_amount`,
ADD `it_sc_qty` INT(11) NOT NULL DEFAULT '0' AFTER `it_sc_minimum` ", false);
}
// 장바구니 배송비필드 추가
$sql = " select ct_send_cost2 from {$g4['shop_cart_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
DROP `ct_send_cost`,
ADD `ct_send_cost` INT(11) NOT NULL DEFAULT '0' AFTER `io_price`,
ADD `ct_send_cost2` TINYINT(4) NOT NULL DEFAULT '0' AFTER `ct_send_cost` ", false);
}
?>

View File

@ -74,7 +74,8 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
`io_price` int(11) NOT NULL DEFAULT '0',
`ct_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ct_ip` varchar(25) NOT NULL DEFAULT '',
`ct_send_cost` varchar(255) NOT NULL,
`ct_send_cost` int(11) NOT NULL DEFAULT '0',
`ct_send_cost2` tinyint(4) NOT NULL DEFAULT '0',
`ct_direct` tinyint(4) NOT NULL DEFAULT '0',
`ct_select` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`ct_id`),

View File

@ -1182,14 +1182,14 @@ function get_item_sendcost($it_id, $uq_id)
global $g4, $default;
if($default['de_send_cost_case'] != '개별')
return false;
return 0;
$sql = " select it_id, it_sc_type, it_sc_method, it_sc_amount, it_sc_minimum, it_sc_qty
from {$g4['shop_item_table']}
where it_id = '$it_id' ";
$it = sql_fetch($sql);
if(!$it['it_id'])
return false;
return 0;
if($it['it_sc_type']) {
if($it['it_sc_type'] == 1) { // 조건부무료

View File

@ -343,22 +343,22 @@ else
<?php } ?>
<?php if($default['de_send_cost_case'] == '개별' && $it['it_sc_type'] != 0) { ?>
<tr>
<th><label for="ct_send_cost">배송비결제</label></th>
<th><label for="ct_send_cost2">배송비결제</label></th>
<td>
<?php
if($it['it_sc_method'] == 2) {
?>
<select name="ct_send_cost" id="ct_send_cost">
<option value="선불">주문시 결제</option>
<option value="착불">수령후 지불</option>
<select name="ct_send_cost2" id="ct_send_cost2">
<option value="0">주문시 결제</option>
<option value="1">수령후 지불</option>
</select>
<?php
} else {
if($it['it_sc_method']) {
echo '<input type="hidden" name="ct_send_cost" value="착불">';
echo '<input type="hidden" name="ct_send_cost2" value="1">';
echo '수령후 지불';
} else {
echo '<input type="hidden" name="ct_send_cost" value="선불">';
echo '<input type="hidden" name="ct_send_cost2" value="0">';
echo '주문시 결제';
}
}

View File

@ -19,7 +19,8 @@ $sql = " select * from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id
$result = sql_query($sql);
// 판매가격
$sql2 = " select ct_price, it_name, ct_send_cost from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$sql2 = " select ct_price, it_name, ct_send_cost, ct_send_cost2
from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$row2 = sql_fetch($sql2);
if(!mysql_num_rows($result))
@ -33,6 +34,7 @@ if(!mysql_num_rows($result))
<input type="hidden" name="it_name" value="<?php echo $row2['it_name']; ?>">
<input type="hidden" name="it_point" value="<?php echo $it_point; ?>">
<input type="hidden" name="ct_send_cost" value="<?php echo $row2['ct_send_cost']; ?>">
<input type="hidden" name="ct_send_cost2" value="<?php echo $row2['ct_send_cost2']; ?>">
<input type="hidden" name="total_price" value="">
<input type="hidden" name="sw_direct">
<?php

View File

@ -231,11 +231,11 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
// 장바구니에 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, ct_send_cost )
( 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, ct_send_cost, ct_send_cost2 )
VALUES ";
for($i=0; $i<$option_count; $i++) {
$sql .= $comma."( '$tmp_uq_id', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$i', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '$ct_send_cost' )";
$sql .= $comma."( '$tmp_uq_id', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$i', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '$ct_send_cost', '$ct_send_cost2' )";
$comma = ' , ';
}
@ -264,6 +264,10 @@ else // 장바구니에 담기
$sql = " select * from {$g4['shop_item_table']} where it_id = '{$_POST['it_id']}' ";
$it = sql_fetch($sql);
$it_send_cost = 0;
if($default['de_send_cost_case'] == '개별')
$it_send_cost = get_item_sendcost($it['it_id'], $tmp_uq_id);
// 옵션정보를 얻어서 배열에 저장
$opt_list = array();
$sql = " select * from {$g4['shop_item_option_table']} where it_id = '{$_POST['it_id']}' and io_use = '1' order by io_no asc ";
@ -355,7 +359,7 @@ else // 장바구니에 담기
$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 )
( 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_send_cost2, ct_direct, ct_select )
VALUES ";
for($i=0; $i<$option_count; $i++) {
@ -376,7 +380,7 @@ else // 장바구니에 담기
continue;
}
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$it_send_cost', '$ct_send_cost2', '$sw_direct', '$ct_select' )";
$comma = ' , ';
$ct_num++;
$ct_count++;

View File

@ -162,7 +162,7 @@ function pg_anchor($anc_id) {
?>
<ul class="sanchor">
<li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li>
<li><a href="#sit_use" <?php if ($anc_id == 'use') echo 'class="sanchor_on"'; ?>>용후기 <span class="item_use_count"></span></a></li>
<li><a href="#sit_use" <?php if ($anc_id == 'use') echo 'class="sanchor_on"'; ?>>용후기 <span class="item_use_count"></span></a></li>
<li><a href="#sit_qa" <?php if ($anc_id == 'qa') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_count"></span></a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="#sit_dvr" <?php if ($anc_id == 'dvr') echo 'class="sanchor_on"'; ?>>배송정보</a></li><?php } ?>
<?php if ($default['de_change_content']) { ?><li><a href="#sit_ex" <?php if ($anc_id == 'ex') echo 'class="sanchor_on"'; ?>>교환정보</a></li><?php } ?>
@ -347,22 +347,22 @@ else
<?php } ?>
<?php if($default['de_send_cost_case'] == '개별' && $it['it_sc_type'] != 0) { ?>
<tr>
<th><label for="ct_send_cost">배송비결제</label></th>
<th><label for="ct_send_cost2">배송비결제</label></th>
<td>
<?php
if($it['it_sc_method'] == 2) {
?>
<select name="ct_send_cost" id="ct_send_cost">
<option value="선불">주문시 결제</option>
<option value="착불">수령후 지불</option>
<select name="ct_send_cost2" id="ct_send_cost2">
<option value="0">주문시 결제</option>
<option value="1">수령후 지불</option>
</select>
<?php
} else {
if($it['it_sc_method']) {
echo '<input type="hidden" name="ct_send_cost" value="착불">';
echo '<input type="hidden" name="ct_send_cost2" value="1">';
echo '수령후 지불';
} else {
echo '<input type="hidden" name="ct_send_cost" value="선불">';
echo '<input type="hidden" name="ct_send_cost2" value="0">';
echo '주문시 결제';
}
}
@ -579,57 +579,13 @@ else
<!-- 상품설명 end -->
<section id="sit_use">
<h2>용후기</h2>
<h2>용후기</h2>
<?php echo pg_anchor('use'); ?>
<?php
/*
<script>
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
</script>
<iframe src="./itemuse.php?it_id=<?php echo $it_id; ?>" id="iframe1" frameborder="0" scrolling="no" onLoad="autoResize('iframe1');">
</iframe>
*/
?>
<?php
/*
$use_page_rows = 10; // 페이지당 목록수
include_once('./itemuse.inc.php');
*/
?>
<div id="itemuse"></div>
<script>
$(function(){
/*
$.get("./itemuse.php", {it_id:<?php echo $it_id; ?>}, function(data){
$("#itemuse").html(data);
});
$('#itemuse').live('click', function(e) {
//alert((this).attr('href'));
//e.preventDefault();
$.get((this).attr('href'), {it_id:<?php echo $it_id; ?>}, function(data) {
//alert(data);
$('#container').html(data);
});
});
*/
$("#itemuse").load("./itemuse.php", {it_id:<?php echo $it_id; ?>});
});
</script>
</section>
<section id="sit_qa">