const someFunc = (price) => {
return {
roznica: price.toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver: Math.ceil(price - price * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold: Math.ceil(price - price * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum: Math.ceil(price - price * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver_sk: Math.ceil(price * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold_sk: Math.ceil(price * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum_sk: Math.ceil(price * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
};
}
const info = {
240: {
5: {
title: titleIbp250,
description: descrIbp250,
silka_ibp: ssilkaIbp3,
kartinka_ibp: kartinkIbp3,
title2: titleAKB_105,
description2: descrAKB_105,
mnoj: '60 x',
silka_akb: silka_akb_105,
kartinka_akb: kartinka_akb_105,
someFunc(cena_roz5_250),
},
10: {
title: titleIbp250,
description: descrIbp250,
silka_ibp: ssilkaIbp3,
kartinka_ibp: kartinkIbp3,
title2: titleAKB_70,
description2: descrAKB_70,
mnoj: '120 x',
silka_akb: silka_akb_70,
kartinka_akb: kartinka_akb_70,
someFunc(cena_roz10_250),
},
15: {
title: titleIbp250,
description: descrIbp250,
silka_ibp: ssilkaIbp3,
kartinka_ibp: kartinkIbp3,
title2: titleAKB_93,
description2: descrAKB_93,
mnoj: '120 x',
silka_akb: silka_akb_93,
kartinka_akb: kartinka_akb_93,
someFunc(cena_roz15_250),
},
},
};
var cena_rozALL = 0;
var roznicaIBP = cena_rozALL.toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var silverIBP = Math.ceil(cena_rozALL - cena_rozALL * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var goldIBP = Math.ceil(cena_rozALL - cena_rozALL * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var platinumIBP = Math.ceil(cena_rozALL - cena_rozALL * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var silver_skIBP = Math.ceil(cena_rozALL * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var gold_skIBP = Math.ceil(cena_rozALL * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
var platinum_skIBP = Math.ceil(cena_rozALL * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 ');
const info = {
10: {
5: {
title: titleIbp10,
description: descrIbp10,
silka_ibp: ssilkaIbp1,
kartinka_ibp: kartinkIbp1,
title2: titleAKB_7,
description2: descrAKB_7,
mnoj: '30 x',
silka_akb: silka_akb_7,
kartinka_akb: kartinka_akb_7,
[cena_rozALL]: cena_roz5_10,
},
10: {
title: titleIbp10,
description: descrIbp10,
silka_ibp: ssilkaIbp1,
kartinka_ibp: kartinkIbp1,
title2: titleAKB_7,
description2: descrAKB_7,
mnoj: '30 x',
silka_akb: silka_akb_7,
kartinka_akb: kartinka_akb_7,
[cena_rozALL]: cena_roz10_10,
}, .....
} ....
};
const info = {
10: {
5: {
title: titleIbp10,
description: descrIbp10,
silka_ibp: ssilkaIbp1,
kartinka_ibp: kartinkIbp1,
title2: titleAKB_7,
description2: descrAKB_7,
mnoj: '30 x',
silka_akb: silka_akb_7,
kartinka_akb: kartinka_akb_7,
roznica: cena_roz5_10.toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver: Math.ceil(cena_roz5_10 - cena_roz5_10 * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold: Math.ceil(cena_roz5_10 - cena_roz5_10 * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum: Math.ceil(cena_roz5_10 - cena_roz5_10 * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver_sk: Math.ceil(cena_roz5_10 * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold_sk: Math.ceil(cena_roz5_10 * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum_sk: Math.ceil(cena_roz5_10 * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
},
10: {
title: titleIbp10,
description: descrIbp10,
silka_ibp: ssilkaIbp1,
kartinka_ibp: kartinkIbp1,
title2: titleAKB_7,
description2: descrAKB_7,
mnoj: '30 x',
silka_akb: silka_akb_7,
kartinka_akb: kartinka_akb_7,
roznica: cena_roz10_10.toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver: Math.ceil(cena_roz10_10 - cena_roz10_10 * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold: Math.ceil(cena_roz10_10 - cena_roz10_10 * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum: Math.ceil(cena_roz10_10 - cena_roz10_10 * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
silver_sk: Math.ceil(cena_roz10_10 * proc_sil).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
gold_sk: Math.ceil(cena_roz10_10 * proc_gold).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
platinum_sk: Math.ceil(cena_roz10_10 * proc_plat).toString().replace(/(\d)(?=(\d{3})+$)/g, '$1 '),
}, .....
} ....
};
document.onmousemove = function(e) {
const slider1value = jQuery("#slider1").roundSlider("option", "value");
const slider2value = jQuery("#slider2").roundSlider("option", "value");
jQuery('.calc_nazvanie').html(info[slider1value][slider2value].title);
jQuery('.calc_descr').html(info[slider1value][slider2value].description);
jQuery('.tovar_ibp').attr('href', info[slider1value][slider2value].silka_ibp);
jQuery('.kartinka_ibp').attr('src', info[slider1value][slider2value].kartinka_ibp);
jQuery('.calc_nazvanie2').html(info[slider1value][slider2value].title2);
jQuery('.calc_descr2').html(info[slider1value][slider2value].description2);
jQuery('.calc_mnojitel_akb').html(info[slider1value][slider2value].mnoj);
jQuery('.tovar_akb').attr('href', info[slider1value][slider2value].silka_akb);
jQuery('.kartinka_akb').attr('src', info[slider1value][slider2value].kartinka_akb);
jQuery('.calc_cena_roz').html(info[slider1value][slider2value].roznica);
jQuery('.diler_silver').html(info[slider1value][slider2value].silver);
jQuery('.diler_gold').html(info[slider1value][slider2value].gold);
jQuery('.diler_platin').html(info[slider1value][slider2value].platinum);
jQuery('.silver_skidka').html(info[slider1value][slider2value].silver_sk);
jQuery('.gold_skidka').html(info[slider1value][slider2value].gold_sk);
jQuery('.platin_skidka').html(info[slider1value][slider2value].platinum_sk);
}
var fff = '20';
const info = {
10: {
5: {
fff = '50',
},
},
setInterval(function(){
var parent = document.querySelectorAll('.cart_item');
for(let i = 0; i<parent.length; i++){
var elems1 = parent[i].querySelector('.meta_wc');
var elems = parent[i].querySelector('.first_size');
if (elems.innerHTML == '' ) {
elems1.style.display = 'none';
};
}
}, 1000);