<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
//Пороговая сумма заказа
const presentSumm = 5000;
const presentInp = document.querySelectorAll("input[name='present']");
const presentWrap = presentInp[0].closest('.t-input-group');
presentWrap.classList.add('hidepresent');
setTimeout(function () {
const observer = new MutationObserver(mutationRecords => {
const prodAmount = window.tcart.prodamount;
if(prodAmount>presentSumm){
presentWrap.classList.remove('hidepresent');
}else{
presentWrap.classList.add('hidepresent');
presentInp.forEach(function (el, index) {
el.checked = false;
});
};
});
const elem = document.querySelector('.t706__cartwin-prodamount');
observer.observe(elem, {
childList: true,
subtree: true,
characterDataOldValue: true
});
}, 1000);
})();
});
</script>
<style>
.t706 .t-bgimg { box-shadow: none}
.t706 .t-img-select__text {text-align: center}
.hidepresent{
height: 0;
opacity: 0;
margin: 0;
pointer-events: none;
}
</style>