|
|
@@ -308,13 +308,11 @@
|
|
|
총 <span id="goodsTotalQty">0</span>개
|
|
|
</p>
|
|
|
<p class="price">
|
|
|
- <span>
|
|
|
- <b id="goodsTotalPrice">0</b><em>원</em>
|
|
|
- </span>
|
|
|
+ <span><b id="goodsTotalPrice">0</b><em>원</em></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="btn_box">
|
|
|
- <button type="button" class="gift" id="btn_gift" onclick="fnAddCart('G','Up');" th:if="${goodsInfo.giftPackYn == 'Y'}">
|
|
|
+ <button type="button" class="gift" id="btnGift" onclick="fnAddCart('G','Up');" style="display:none;">
|
|
|
<span><span>선물해보세요!</span></span>
|
|
|
</button>
|
|
|
<th:block th:if="${goodsInfo.stockQty > 0 and goodsInfo.goodsStat == 'G008_90'}">
|
|
|
@@ -690,7 +688,7 @@
|
|
|
if (item.addPrice > 0){
|
|
|
tag2 += '<div class="opt_price">+'+ item.addPrice.addComma() +'원</div>\n';
|
|
|
}
|
|
|
- tag2 += '<input type="hidden" name="opt2" value="'+ goodsCd +'" currPrice="'+ currPrice+'" addPrice="'+item.addPrice+'" optCd="'+item.optCd+'" optCd1="'+item.optCd1+'" optCd1Nm="'+item.optCd1Nm+'" optCd2="'+item.optCd2+'" minOrdQty="'+minOrdQty+'" maxOrdQty="'+maxOrdQty+'" selfGoodsYn="'+selfGoodsYn+'"/>\n';
|
|
|
+ tag2 += '<input type="hidden" name="opt2" value="'+ goodsCd +'" currPrice="'+ currPrice+'" addPrice="'+item.addPrice+'" optCd="'+item.optCd+'" optCd1="'+item.optCd1+'" optCd1Nm="'+item.optCd1Nm+'" optCd2="'+item.optCd2+'" minOrdQty="'+minOrdQty+'" maxOrdQty="'+maxOrdQty+'" selfGoodsYn="'+selfGoodsYn+'" giftPackYn="'+item.giftPackYn+'"/>\n';
|
|
|
tag2 += '</li>\n';
|
|
|
|
|
|
tagUpS += tag1+tagUp+tag2;
|
|
|
@@ -728,6 +726,7 @@
|
|
|
let maxOrdQty = $target.attr("maxOrdQty");
|
|
|
let addPrice = $target.attr("addPrice");
|
|
|
let selfGoodsYn = $target.attr("selfGoodsYn");
|
|
|
+ let giftPackYn = $target.attr("giftPackYn");
|
|
|
let optQty = minOrdQty;
|
|
|
|
|
|
let params = new Object();
|
|
|
@@ -779,7 +778,7 @@
|
|
|
tag += ' </div>\n';
|
|
|
tag += ' <div class="number_count">\n';
|
|
|
tag += ' <span class="minus min_val" onclick="fnAdjustOrderEa(this);" adjust="-"><em class="sr-only">감소</em></span>\n';
|
|
|
- tag += ' <input type="text" name="cea" optCd="'+optCd+'" maxlength="3" style="ime-mode:disabled" value="' +optQty+'" readonly minOrdQty="'+minOrdQty+'" maxOrdQty="'+maxOrdQty+'">\n';
|
|
|
+ tag += ' <input type="text" name="cea" optCd="'+optCd+'" maxlength="3" style="ime-mode:disabled" value="' +optQty+'" readonly minOrdQty="'+minOrdQty+'" maxOrdQty="'+maxOrdQty+'" giftPackYn="'+giftPackYn+'">\n';
|
|
|
tag += ' <input type="hidden" name="coption" value="'+optCd+'" goodsCd="'+goodsCd+'" price="'+currPrice+'" addPrice="'+addPrice+'">\n';
|
|
|
tag += ' <span class="plus" onclick="fnAdjustOrderEa(this);" adjust="+"><em class="sr-only">추가</em></span>\n';
|
|
|
tag += ' </div>\n';
|
|
|
@@ -789,11 +788,13 @@
|
|
|
tag += ' <button type="button" class="btn_delete_item" onclick="fnSelectGoodsDel(\''+optCd+'\')"><span>삭제</span></button>\n';
|
|
|
tag += '</div>\n';
|
|
|
|
|
|
-
|
|
|
let $objUp = null;
|
|
|
$objUp = $('.pd_detail .opt_result');
|
|
|
$objUp.prepend(tag);
|
|
|
|
|
|
+ //선물 주문관련 처리
|
|
|
+ if ("Y" == giftPackYn) $('#btnGift').show();
|
|
|
+
|
|
|
$('.price_box').show();
|
|
|
fnSetTotalPrice();
|
|
|
|
|
|
@@ -961,6 +962,22 @@
|
|
|
var fnSelectGoodsDel = function(optCd){
|
|
|
$('.result_'+optCd).remove();
|
|
|
fnSetTotalPrice();
|
|
|
+
|
|
|
+ //선물주문관련 처리
|
|
|
+ let $target = $('#cartForm input[name=cea]');
|
|
|
+ let giftPackFlag = false;
|
|
|
+ $target.each(function() {
|
|
|
+
|
|
|
+ let giftPackYn = $(this).parent().find('input[name="coption"]').attr('giftPackYn');
|
|
|
+ if ("Y" == giftPackYn ) giftPackFlag = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (giftPackFlag){
|
|
|
+ $('#btnGift').show();
|
|
|
+ }else{
|
|
|
+ $('#btnGift').hide();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//장바구니담기
|