옵션 변경사항 저장 관련 코드 수정

This commit is contained in:
chicpro
2013-05-27 18:28:30 +09:00
parent 05b9a02dfb
commit 6eaafefdbe

View File

@ -129,6 +129,12 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
if (!$_POST['it_id']) if (!$_POST['it_id'])
alert('장바구니에 담을 상품을 선택하여 주십시오.'); alert('장바구니에 담을 상품을 선택하여 주십시오.');
// 기존 장바구니 자료를 먼저 삭제
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and it_id = '$it_id' ");
$option_count = count($_POST['io_id']);
if($option_count) {
if($_POST['io_type'][0] != 0) if($_POST['io_type'][0] != 0)
alert('상품의 선택옵션을 선택해 주십시오.'); alert('상품의 선택옵션을 선택해 주십시오.');
@ -141,7 +147,6 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
// 변조 검사 // 변조 검사
//-------------------------------------------------------- //--------------------------------------------------------
$total_price = 0; $total_price = 0;
$option_count = count($_POST['io_id']);
$sql = " select * from {$g4['shop_item_table']} where it_id = '{$_POST['it_id']}' "; $sql = " select * from {$g4['shop_item_table']} where it_id = '{$_POST['it_id']}' ";
$it = sql_fetch($sql); $it = sql_fetch($sql);
@ -213,14 +218,10 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` ADD `ct_direct` TINYINT NOT NULL "); 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; } if (!$config['cf_use_point']) { $_POST['it_point'] = 0; }
// 장바구니에 Insert // 장바구니에 Insert
if(count($_POST['io_id'])) {
$comma = ''; $comma = '';
$sql = " INSERT INTO {$g4['shop_cart_table']} $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 ) ( 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 )