function updateSummary() {
//Marketing UwU
const origprice = parseFloat(price / (1 - discount));
origprice = (origprice / 0.75).toFixed(2);
$("#original-price").text(currencyConversion(origprice));
$("#original-price").attr("data-price", origprice);
$("#total-price").text(currencyConversion(price));
$("#total-price").attr("data-price", price);
// $('#completion-time').text((completion_time <= 0 ? "Invalid" : completion_time <= 24 ? completion_time + " Hours" : Math.ceil(completion_time / 24) + " Days"));
$('input[name="sbtgvh"]').val(formatCrypt(currencyConversion(subtotal_price)));
$('input[name="exjgvh"]').val(formatCrypt(currencyConversion(extra_price)));
$('input[name="toqgvh"]').val(formatCrypt(currencyConversion(price)));
$('input[name="currency"]').val($("#local_currency").val());
formUpdated();
function sendErrorMsg() {
$("#purchase-boost").html('<i class="uil uil-exclamation-circle" style="vertical-align: middle;"></i>' + "Выбор услуги невозможен");
$("#purchase-boost").attr("disabled", "disabled");
}
if (current_tier_num < desired_tier_num) return;
if (current_tier_num !== desired_tier_num) return sendErrorMsg();
switch (current_division) {
case "i":
if (desired_division === "i") sendErrorMsg();
break;
case "ii":
if (desired_division != "iii") sendErrorMsg();
break;
case "iii":
sendErrorMsg();
break;
}
return;
}
function normalMatches() {
formUpdate();
if (duo_regular) {
$(".solo-options, .solo-text").addClass("d-none");
$(".solo-options, .solo-text").removeClass("d-flex");
$(".duo-options, .duo-text").addClass("d-flex");
$(".duo-options, .duo-text").removeClass("d-none");
$(".solo-options :input").prop("checked", false);
streaming = false;
} else {
$(".duo-options, .duo-text").addClass("d-none");
$(".duo-options, .duo-text").removeClass("d-flex");
$(".solo-options, .solo-text").addClass("d-flex");
$(".solo-options, .solo-text").removeClass("d-none");
$(".duo-options :input").prop("checked", false);
duo_premium = false;
}
//price
if (getRegion(server) == "EU") {
pricepergame = 70;
} else {
pricepergame = 70;
}
price = pricepergame * games_amount;
completion_time = 1 * games_amount;
if (getRegion(server) == "OTHER") {
price += price * 0.0;
}
if (duo_regular) {
price += price * 0.4;
}
subtotal_price = price.toFixed(2);
extra_price = 0;
if (priority_boost) {
extra_price += price * 0.2;
}
if (streaming) {
extra_price += price * 0.15;
}
if (prime_time) {
extra_price += price * 0.0;
}
if (duo_premium) {
extra_price += price * 0.3;
}
extra_price = extra_price.toFixed(2);
price = price + parseFloat(extra_price);
price = price - price * discount;
price = parseFloat(price.toFixed(2));
updateSummary();
}
parseInt(price);
Пример:
10.15 => 10
"10,15" => 10