<style>
/*Размер*/
.t-product__option-checkmark.t-product__option-checkmark_buttons.t-product__option-checkmark_color {
width: 35px;
height: 35px;
}
.t-product__option-checkmark{
background-size: contain;
background-repeat: no-repeat;
}
/*Белое дерево*/
.t-product__option-checkmark[style="background-color: #f0ebeb;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/fasadcvet/p/beloe-derevo.jpg);
}
/*Дуб ваниль*/
.t-product__option-checkmark[style="background-color: #d6b4b4;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/klassicheskie-kuhni-mdf/ajvori/dub-vanil.jpg);
}
/*Дуб кофе*/
.t-product__option-checkmark[style="background-color: #ad7474;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/klassicheskie-kuhni-mdf/ajvori/dub-kofe.jpg);
}
/*Латте*/
.t-product__option-checkmark[style="background-color: #692c2c;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/latte.jpg);
}
/*Дуб бирюза*/
.t-product__option-checkmark[style="background-color: #56f5ea;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/dub-biryuza.jpg);
}
/*Лебединое озеро*/
.t-product__option-checkmark[style="background-color: #9c7d7d;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/lebedinoe-ozero.jpg);
}
/*Скай*/
.t-product__option-checkmark[style="background-color: #82c4f0;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/skaj.jpg);
}
/*Джинс*/
.t-product__option-checkmark[style="background-color: #2867c7;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/dzhins.jpg);
}
/*Венге*/
.t-product__option-checkmark[style="background-color: #2e2323;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/fasadcvet/a/venge.jpg);
}
/*Сандал белый*/
.t-product__option-checkmark[style="background-color: #fcfcfc;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/sandal-belyj.jpg);
}
/*Сандал серый*/
.t-product__option-checkmark[style="background-color: #a69f9f;"] {
background-image: url(https://fores-mebel.ru/assets/images/catalog/kuhni/tekstury/sandal-seryj.jpg);
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function(){
let weightDiv = '';
function ChangeDelivery(){
let cart = document.querySelectorAll('div[data-record-type="706"]');
if(cart.length){
if(tcart.total){
let summ = tcart.prodamount;
if(summ<100){
$('.t-radio__wrapper-delivery label:eq(1) input').attr('data-delivery-price', 9);
}else{
$('.t-radio__wrapper-delivery label:eq(1) input').attr('data-delivery-price', 13);
};
tcart__updateDelivery();
};
};
};
function startChDeliv(){
ChangeDelivery();
setTimeout(function(){ ChangeDelivery()}, 4500);
};
setTimeout(function(){
startChDeliv();
}, 1500);
//При нажатии на кнопку корзину
let cartIcon = document.querySelectorAll('.t706__carticon');
cartIcon.forEach(i => i.addEventListener('click', startChDeliv ) );
//При нажатии на минус, плюс и удаление в корзине
let cartProd = document.querySelectorAll('.t706__cartwin-products');
cartProd.forEach(i => i.addEventListener('click', startChDeliv ) );
//При потере фокуса в поле количества в корзине
let cartQ = document.querySelectorAll('.t706__cartwin-products');
for (let i = 0; i < cartQ.length; i++) {
cartQ[i].addEventListener('input', function() {
setTimeout(function(){
let cartQinp = document.querySelectorAll('.t706__cartwin-products input');
cartQinp.forEach(i => i.addEventListener('focusout', startChDeliv ) );
}, 500);
});
};
//При нажатии на кнопку #order , minus, plus, delete
document.addEventListener('click', function(e){
let el = false; let link = e.target.getAttribute('href');
if (link != null) { if(link.includes('#order')) el = true;
}else{ if( e.target.closest('a[href^="#order"]') !=null ) el = true };
if(el) startChDeliv();
});
});
</script>