// @ts-expect-error ST-2949_1
4217 tcart__updateTotalProductsinCartObj(); 4218 tcart__reDrawCartIcon(); 4219 tcart__reDrawTotal(); 4222 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4223 // @ts-expect-error ST-2949_1 4224 if (cart.products && cart.products.length > 0 && cart['total'] > 0) { 4225 cartIcon.classList.add('t706__carticon_showed'); 4227 cartIcon.classList.remove('t706__carticon_showed'); 4229 t_onFuncLoad('t_posWidget__updateStyleWidget', function () { 4230 // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) 4231 // @ts-expect-error ST-2949_4 4232 t_posWidget__updateStyleWidget(); 4236 var isZeroBecauseOfDiscount = 4237 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4238 // @ts-expect-error ST-2949_1 4239 typeof cart.prodamount === 'number' && 4240 // @ts-expect-error ST-2949_1 4241 typeof cart.dyndiscount === 'number' && 4242 // @ts-expect-error ST-2949_1 4243 cart.prodamount === cart.dyndiscount; 4244 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 4245 // @ts-expect-error ST-2949_2 4246 if (cart['amount'] > 0 || isZeroBecauseOfDiscount) { 4247 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4248 // @ts-expect-error ST-2949_1 4249 cartIconText.style.display = 'block'; 4251 // @ts-expect-error ST-2949_1 4252 cartIconText.style.display = 'none'; 4256 tcart__delZeroquantity_inCartObj(); 4258 document.removeEventListener('keyup', tcart__keyUpFunc); 4260 if (cartIcon) cartIcon.classList.remove('t706__carticon_neworder'); 4261 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4262 // @ts-expect-error ST-2949_1 4263 cartWindow.style.transition = 'opacity .3s'; 4264 // @ts-expect-error ST-2949_1 4265 cartWindow.style.opacity = 0; 4267 setTimeout(function () { 4268 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 4269 // @ts-expect-error ST-2949_3 4270 cartWindow.classList.remove('t706__cartwin_showed'); 4271 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4272 // @ts-expect-error ST-2949_1 4273 cartWindow.style.opacity = '1'; 4276 // @ts-expect-error ST-2949_1 4277 if (window.tcart_success == 'yes') { 4282// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 4283// @ts-expect-error ST-2949_2 4284function tcart__getLostCart(params) { 4285 var apiUrl = 'https://forms.tildacdn.com/api/v1/getlostbasket/'; 4286 var xhr = new XMLHttpRequest(); 4287 xhr.open('POST', apiUrl); 4288 xhr.onload = function () { 4289 if (xhr.status >= 200 && xhr.status < 400) { 4290 var data = xhr.responseText; 4291 if (typeof data !== 'string' || data.substr(0, 1) !== '{') { 4292 console.error("Can't get array."); 4294 var productsArr = []; 4298 dataObj = JSON.parse(data); 4299 productsArr = dataObj.jsonproducts;