Стоимость занятия
Скидки для групп
<script>
$('input[value="formcalc"]').closest('form').addClass('formcalc');
let clc = $('input[name="finalsumm"]');
$('input[name="fsumm"]').closest('.t-input-group').hide();
let discInp = $('input[name="discount"]');
discInp.closest('.t-input-group').hide();
let discountObj = {
"3000" : "400",
"5000" : "800",
"8000" : "1500"
};
function findResult(){
setTimeout(function(){
let adult = +$('input[name="adult"]').val();
let children = +$('input[name="children"]').val();
let summ = adult*1000 + children*600;
let discount = 0;
$.each(discountObj, function( key, value ) {
let ln = +key;
if(summ>=ln) discount = +value;
});
discInp.val(discount);
discInp[0].dispatchEvent(new Event('input', { bubbles: true }));
}, 300);
};
$(document).ready(function(){
findResult();
$(".formcalc").on('change click keyup', "input, .t-inputquantity__btn", function() {findResult()});
});
</script>
<style>
.t706__product-title {
font-weight: 300;
font-size: 14px;
}
</style>