구매금액이 음수인 경우 구매하지 못하도록 수정

This commit is contained in:
chicpro
2014-03-06 14:51:54 +09:00
parent 68e9f530b9
commit 2b994a9f11
2 changed files with 22 additions and 0 deletions

View File

@ -250,6 +250,7 @@ $(function() {
// 선택옵션 추가처리
function sel_option_process(add_exec)
{
var it_price = parseInt($("input#it_price").val());
var id = "";
var value, info, sel_opt, item, price, stock, run_error = false;
var option = sep = "";
@ -285,6 +286,12 @@ function sel_option_process(add_exec)
price = info[1];
stock = info[2];
// 금액 음수 체크
if(it_price + parseInt(price) < 0) {
alert("구매금액이 음수인 상품은 구매할 수 없습니다.");
return false;
}
if(add_exec) {
if(same_option_check(option))
return;
@ -317,6 +324,12 @@ function sel_supply_process($el, add_exec)
var price = info[1];
var stock = info[2];
// 금액 음수 체크
if(parseInt(price) < 0) {
alert("구매금액이 음수인 상품은 구매할 수 없습니다.");
return false;
}
if(add_exec) {
if(same_option_check(option))
return;

View File

@ -215,6 +215,15 @@ else // 장바구니에 담기
$io_price = $opt_list[$io_type][$io_id]['price'];
$ct_qty = $_POST['ct_qty'][$it_id][$k];
// 구매가격이 음수인지 체크
if($io_type) {
if((int)$io_price < 0)
alert('구매금액이 음수인 상품은 구매할 수 없습니다.');
} else {
if((int)$it['it_price'] + (int)$io_price < 0)
alert('구매금액이 음수인 상품은 구매할 수 없습니다.');
}
// 동일옵션의 상품이 있으면 수량 더함
$sql2 = " select ct_id
from {$g5['g5_shop_cart_table']}