|
|
@@ -497,7 +497,7 @@ $(document).ready( function() {
|
|
|
custemerInfoSet();
|
|
|
|
|
|
// 999. 개발화면정보설정
|
|
|
- var devTemp = false;
|
|
|
+ var devTemp = true;
|
|
|
var arr = []
|
|
|
arr[0] = "orderInfo";
|
|
|
arr[1] = "freegiftInfo";
|
|
|
@@ -984,6 +984,9 @@ var dcAmtInfoSet = function() {
|
|
|
},
|
|
|
success : function(result) {
|
|
|
$("#couponModifyPop").html(result);
|
|
|
+
|
|
|
+ // 1.8.2 쿠폰적용초기화(할인율최고)
|
|
|
+ custCpnInit();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -991,12 +994,10 @@ var dcAmtInfoSet = function() {
|
|
|
$("#btn_couponModify_pop").on("click", function(){
|
|
|
$("#couponModifyPop").modal("show");
|
|
|
});
|
|
|
+
|
|
|
|
|
|
|
|
|
/*
|
|
|
- // 1.8.2 쿠폰적용초기화(할인율최고)
|
|
|
- custCpnInit();
|
|
|
-
|
|
|
// 1.8.3 쿠폰 SELECT BOX 기능 설정(js적용)
|
|
|
$('.select_custom.type1').each(function(index){
|
|
|
var selecter01 = new sCombo($(this));
|
|
|
@@ -1176,7 +1177,7 @@ var dcAmtInfoSet = function() {
|
|
|
var custCpnInit = function() {
|
|
|
|
|
|
// 쿠폰적용없음적용
|
|
|
- $(".select_custom.type1").each(function(index){
|
|
|
+ $(".goodsCpn").each(function(index){
|
|
|
// select box 쿠폰 적용
|
|
|
var cpnCartSq = $(this).find("input[name='cpnCartSq']").val();
|
|
|
|
|
|
@@ -1191,35 +1192,38 @@ var custCpnInit = function() {
|
|
|
$(this).find("input[name='custCpnSq']").val("0");
|
|
|
$(this).find("input[name='cpnDcAmt']").val("0");
|
|
|
|
|
|
- $(this).find(".select").text("선택없음");
|
|
|
- $(this).find(".cp_discount").css("display", "none");
|
|
|
+ // 적용안함 적용
|
|
|
+ var emptyHtml = $(this).find("ul li .item_coupon.empty").html();
|
|
|
+ $(this).find(".select .item_coupon").html(emptyHtml);
|
|
|
});
|
|
|
|
|
|
// 최대할인율 쿠폰적용
|
|
|
- $('.select_custom.type1').each(function(index){
|
|
|
- cpnIndex = 0;
|
|
|
+ $('.goodsCpn').each(function(index){
|
|
|
cpnApplyTemp = false;
|
|
|
|
|
|
// select 박스 반복문 실행
|
|
|
$(this).find("ul li").each(function(i){
|
|
|
- cpnIndex++;
|
|
|
-
|
|
|
- // 1이상부터 중복 체크
|
|
|
if (cpnApplyTemp == false) {
|
|
|
- if (cpnIndex > 1) {
|
|
|
- if (custCpnDuplicationCheck($(this).prop("value"), index)) {
|
|
|
- // 쿠폰적용
|
|
|
- custCpnApply($(this));
|
|
|
- // 쿠폰할인적용
|
|
|
- cpnApplyTemp = true;
|
|
|
- }
|
|
|
+ if (custCpnDuplicationCheck($(this).prop("value"), index)) {
|
|
|
+ // 쿠폰적용
|
|
|
+ custCpnApply($(this));
|
|
|
+ // 쿠폰할인적용
|
|
|
+ cpnApplyTemp = true;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ // 장바구니쿠폰 초기화 적용
|
|
|
+ $(".cartCpn").each(function(index) {
|
|
|
+ if (index == 0) {
|
|
|
+ // 쿠폰적용
|
|
|
+ custCpnApply($(this));
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 포인트기능 리렛
|
|
|
- pntDcAmtReset();
|
|
|
+ //pntDcAmtReset();
|
|
|
}
|
|
|
|
|
|
// 1.10 쿠폰중복사용체크
|
|
|
@@ -1228,7 +1232,7 @@ var custCpnDuplicationCheck = function(custCpnSq, index) {
|
|
|
var cnt = 0;
|
|
|
|
|
|
// 쿠폰중본사용체크
|
|
|
- $("input[name='custCpnSq']").each(function(i){
|
|
|
+ $(".goodsCpn input[name='custCpnSq']").each(function(i){
|
|
|
if (index != i) {
|
|
|
selCustSq = $(this).val();
|
|
|
if (selCustSq == custCpnSq) {
|
|
|
@@ -1250,30 +1254,20 @@ var custCpnDuplicationCheck = function(custCpnSq, index) {
|
|
|
// 1.11 쿠폰중복체크 후 적용가능
|
|
|
var custCpnApply = function(obj) {
|
|
|
// select box 쿠폰 적용
|
|
|
- var cpnType = obj.parent().parent().find("input[name='cpnType']").val();
|
|
|
+ var cpnType = obj.parent().find("input[name='cpnType']").val();
|
|
|
|
|
|
// 상품쿠폰적용
|
|
|
if (cpnType == "goodsCpn") {
|
|
|
- // 적용된 할인금액 text 설정
|
|
|
- var dcAmtStr = "- " + parseInt(obj.attr("data")).addComma() + " 원 할인적용";
|
|
|
- obj.parent().parent().parent().parent().parent().find(".cp_amount").text(dcAmtStr);
|
|
|
-
|
|
|
- var cpnCartSq = obj.parent().parent().find("input[name='cpnCartSq']").val();
|
|
|
-
|
|
|
- // 장바구니시퀀스 체크
|
|
|
- $(".cartSq").each(function(){
|
|
|
- if (cpnCartSq == $(this).text()) {
|
|
|
- $(this).parent().find(".goodsCpnSq").text(obj.prop("value")); // 상품쿠폰시퀀스
|
|
|
- $(this).parent().find(".goodsCpnDcAmt").text(obj.attr("data")); // 상품쿠폰할인금액
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- obj.parent().parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
|
|
|
+ // 적용안함 적용
|
|
|
+ var itemHtml = obj.find(".item_coupon").html();
|
|
|
+ obj.parent().parent().find(".select .item_coupon").html(itemHtml);
|
|
|
+ obj.parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
|
|
|
+ obj.parent().find("input[name='custCpnSq']").val(obj.attr("value"));
|
|
|
}
|
|
|
// 장바구니쿠폰적용
|
|
|
else if (cpnType == "cartCpn") {
|
|
|
- var dcWay = obj.parent().find("input[name='dcWay']").val();
|
|
|
- var dcVal = obj.parent().find("input[name='dcVal']").val();
|
|
|
+ var dcWay = obj.find("input[name='dcWay']").val();
|
|
|
+ var dcVal = obj.find("input[name='dcVal']").val();
|
|
|
var cartCpnDcSumAmt = 0;
|
|
|
var tempSumAmt = 0;
|
|
|
var cartSqLen = $(".cartSq").length;
|
|
|
@@ -1297,7 +1291,7 @@ var custCpnApply = function(obj) {
|
|
|
tempSumAmt = tempSumAmt + tempAmt;
|
|
|
|
|
|
// 할인율일때 할인금액
|
|
|
- if (dcWay == "G240_20") {
|
|
|
+ if (dcWay == "G240_11") {
|
|
|
cartCpnDcAmt = (tempAmt * dcVal) / 100;
|
|
|
cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
|
|
|
|
|
|
@@ -1338,20 +1332,20 @@ var custCpnApply = function(obj) {
|
|
|
leftAmt = leftAmt - cartCpnDcAmt;
|
|
|
}
|
|
|
|
|
|
- $(this).parent().find(".cartCpnSq").text(obj.prop("value"));
|
|
|
+ $(this).parent().find(".cartCpnSq").text(obj.attr("value"));
|
|
|
$(this).parent().find(".cartCpnDcAmt").text(cartCpnDcAmt);
|
|
|
|
|
|
index++;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
- obj.parent().parent().find("input[name='cpnDcAmt']").val(cartCpnDcSumAmt);
|
|
|
+ }
|
|
|
|
|
|
- var dcAmtStr = "- " + cartCpnDcSumAmt.addComma() + " 원 할인적용";
|
|
|
- obj.parent().parent().parent().parent().parent().find(".cp_amount").text(dcAmtStr);
|
|
|
+ obj.find("input[name=rdi-cart-coupon]").prop("checked", true);
|
|
|
+ obj.parent().find("input[name=cpnDcAmt]").val(cartCpnDcSumAmt);
|
|
|
+ obj.parent().find("input[name=custCpnSq]").val(obj.attr("value"));
|
|
|
}
|
|
|
+ /*
|
|
|
// 배송비쿠폰적용
|
|
|
else if (cpnType == "delvCpn") {
|
|
|
var delvFee = parseInt(obj.attr("delvfee"));
|
|
|
@@ -1376,7 +1370,6 @@ var custCpnApply = function(obj) {
|
|
|
$(".delvCpnDcSumAmt").text(obj.attr("data"));
|
|
|
|
|
|
// 배송비쿠폰 테이블 적용
|
|
|
-
|
|
|
$(".delvFeeCd").each(function(){
|
|
|
if ($(this).text() == delvFeeCd) {
|
|
|
$(this).parent().find(".delvCpnSq").text(obj.prop("value"));
|
|
|
@@ -1384,20 +1377,22 @@ var custCpnApply = function(obj) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
// select box 쿠폰 적용 (공통적용)
|
|
|
- obj.parent().parent().find("input[name='custCpnSq']").val(obj.prop("value"));
|
|
|
- obj.parent().parent().find(".select").text(obj.text());
|
|
|
+ obj.parent().find("input[name='custCpnSq']").val(obj.prop("value"));
|
|
|
|
|
|
// 선택된 할인금액 노출
|
|
|
- obj.parent().parent().parent().parent().parent().find(".cp_discount").css("display", "block");
|
|
|
+ //obj.parent().parent().parent().parent().parent().find(".cp_discount").css("display", "block");
|
|
|
|
|
|
// 포인트기능 리렛
|
|
|
- pntDcAmtReset();
|
|
|
+ //pntDcAmtReset();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 1.12 쿠폰중복체크 후 적용불가
|
|
|
var custCpnNotApply = function(obj) {
|
|
|
+ /*
|
|
|
// 이전에 등록된 쿠폰시퀀스
|
|
|
var custCpnSq = obj.parent().parent().find("input[name='custCpnSq']").val();
|
|
|
|
|
|
@@ -1416,10 +1411,12 @@ var custCpnNotApply = function(obj) {
|
|
|
|
|
|
// 포인트기능 리렛
|
|
|
pntDcAmtReset();
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
// 1.13 쿠폰 선택없음 기능 구현
|
|
|
var cpnApplyDel = function(obj) {
|
|
|
+ /*
|
|
|
// 쿠폰타입(상품쿠폰, 장바구니쿠폰, 배송비쿠폰)
|
|
|
var cpnType = obj.parent().parent().find("input[name='cpnType']").val();
|
|
|
|
|
|
@@ -1468,6 +1465,7 @@ var cpnApplyDel = function(obj) {
|
|
|
if ($("#chk-maxdisc").is(":checked")) {
|
|
|
$("#chk-maxdisc").attr("checked", false);
|
|
|
}
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
// 1.14 선포인트리셋기능 (사용안함)
|