item.form.skin에서
본문
<div id="sit_tot_price"></div>
가격을 합은 어디서 계산을 하나요?
답변 4
/js/shop.js
function price_calculate()
{
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;
}
});
$("#sit_tot_price").empty().html("총 금액 : "+number_format(String(total))+"원");
}
에 정의된 파일 같습니다..
너무 감사합니다.많이 도움이 되네요 분석한지 얼마안되서요 저도 게시판에 뎃글남길 날이 오겠죠?
아 저도 이것때문에 지난번 질문했었는데
JQUERY 입니다 ㅎㅎ