자바스크립트 변수를 php 변수로...
본문
아래 자바스크립트는 영카트5의 상품 구매시 증가, 감소 부분의 총 금액을 출력하는 페이지인데요?
뭘하나 추가하려고 하는데..
아래 추가해놓은 부분이 있습니다. t_price라는 변수를 php 변수로 받을 수 있을까요?
/////////////////////////////////////////////////////////////////////
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;
t_price = total; // t_price 변수를 php 변수로 받을 수 있는지요
}
});
$("#sit_tot_price").empty().html("총 금액 : "+number_format(String(total)));
}
답변 3
네 답변감사합니다.^^
많은 도움이 되었습니다. 감사합니다.