вот мой сайт http://iadprint.com/products?product=product%201
при выборе раскрывающегося списка для атрибута 19k значение цены изменяется. но при выборе других вариантов ничего не происходит. если вы посмотрите в исходном коде внизу, это js, который я поставил. то, что должно происходить, это каждый раз, когда выбирается выбор, значение накапливается в общую переменную и отображается в ценовом диапазоне. но я не могу понять, почему это не работает. переменные назначены, но вычисления не проводятся. Кто-нибудь может увидеть то, что я не вижу?
спасибо
PS вот JS
var woattribute19k_price;
var woattribute2_price;
var woattribute3_price;
var woattribute4_price;
var woattribute5_price;
$(document).ready(function() {
$("#attribute19k").change(function()
{
hash = $("#attribute19k").val();
$.get("ajax.php", { id: hash },
function(out)
{
woattribute19k_price = out.price;
displayPrice();
}, "json");
});
$("#attribute2").change(function()
{
hash = $("#attribute2").val();
$.get("ajax.php", { id: hash },
function(out)
{
woattribute2_price = out.price;
displayPrice();
}, "json");
});
$("#attribute3").change(function()
{
hash = $("#attribute3").val();
$.get("ajax.php", { id: hash },
function(out)
{
woattribute3_price = out.price;
displayPrice();
}, "json");
});
$("#attribute4").change(function()
{
hash = $("#attribute4").val();
$.get("ajax.php", { id: hash },
function(out)
{
woattribute4_price = out.price;
displayPrice();
}, "json");
});
$("#attribute5").change(function()
{
hash = $("#attribute5").val();
$.get("ajax.php", { id: hash },
function(out)
{
woattribute5_price = out.price;
displayPrice();
}, "json");
});
});
function displayPrice()
{
var total = 0;
var qattribute19k = parseFloat((woattribute19k_price != null) ? woattribute19k_price : 0);
total = parseFloat(total + qattribute19k).toFixed(2);
var qattribute2 = parseFloat((woattribute2_price != null) ? woattribute2_price : 0);
total = parseFloat(total + qattribute2).toFixed(2);
var qattribute3 = parseFloat((woattribute3_price != null) ? woattribute3_price : 0);
total = parseFloat(total + qattribute3).toFixed(2);
var qattribute4 = parseFloat((woattribute4_price != null) ? woattribute4_price : 0);
total = parseFloat(total + qattribute4).toFixed(2);
var qattribute5 = parseFloat((woattribute5_price != null) ? woattribute5_price : 0);
total = parseFloat(total + qattribute5).toFixed(2);
$("#pricing span").text('$' + total);
}