영카트 shop.override.js 파일 수정문의
본문
영카트 관리자 '쇼핑몰관리'에 'de_aaa_sale'필드를 만들어 특정금액을 입력하게 했습니다.
shop.override.js 파일에서 자동 금액계산 부분에 특정금액이포함되어 계산되게 하려하는데 'de_aaa_sale'에 넣은 값을 어떻게 불러와야 되는지요?
if (typeof price_calculate === "function") {
price_calculate = (function() {
var cached_function = price_calculate;
return function() {
if( $(".2017_renewal_itemform").length ){
var it_price = parseInt($("input#it_price").val());
if(isNaN(it_price))
return;
var $el_prc = $("input.io_price");
var $el_qty = $("input[name^=ct_qty]");
var $el_type = $("input[name^=io_type]");
var price, type, qty, total = 0;
$el_prc.each(function(index) {
price = parseInt($(this).val());
qty = parseInt($el_qty.eq(index).val());
type = $el_type.eq(index).val();
if(type == "0") { // 선택옵션
total += (it_price + price) * qty ;
} else { // 추가옵션
total += price * qty;
}
total = total - de_aaa_sale;
});
$("#sit_tot_price").empty().html("<span>TOTAL </span><strong> $ "+String(total));
} else {
cached_function.apply(this, arguments); // use .apply() to call it
}
};
}());
} //end if check function
답변 1
de_aaa_sale 가
<input type="text" name="de_aaa_sale" ~ > 형태라면,
de_aaa_sale = $("input[name='de_aaa_sale']").val();
로 가져올 수 있습니다.
!-->