window.tcart.products.forEach(function (product, index) { var uid = product.uid || product.lid; if (uidBad == uid) { // @ts-expect-error ST-2949_1 window.tcart.products[index] = {}; } }); } if (prodBad.error === 'SKU_CHANGED') { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 window.tcart.products.forEach(function (prodInCart, index) { var uid = prodInCart.uid || prodInCart.lid; if (uidBad == uid) { // @ts-expect-error ST-2949_1 window.tcart.products[index].sku = prodBad.last_sku; } }); } }); tcart__saveLocalObj(); tcart__reDrawProducts(); tcart__updateTotalProductsinCartObj(); tcart__reDrawCartIcon(); tcart__reDrawTotal(); } }}/** * Обновляет количество товаров в корзине **/function tcart__updateTotalProductsinCartObj() { var projectIdEl = document.getElementById('allrecords'); if (projectIdEl) { var inEditor = projectIdEl.getAttribute('data-tilda-mode') === 'edit'; if (!inEditor && window.tcart) { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (typeof window.cartCalculator === 'undefined') { // @ts-expect-error ST-2949_1 window.cartCalculator = new CartCalculator({ // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) // @ts-expect-error ST-2949_5 discounts: window.t_cart__discounts, debug: window.showdiscountdata, // @ts-expect-error ST-2949_5 sumpromowithdiscount: window.sumpromowithdiscount, }); } // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 window.cartCalculator.calcDiscounts(window.tcart); tcart__updateCartIconDiscountAmount(); } else if ( window.t_cart__discounts && window.t_cart__discounts.length !== 0 && Array.isArray(window.t_cart__discounts) && !inEditor ) { // calc discounts tcart__onFuncLoad('tcart__calcAmountWithDiscounts', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 tcart__calcAmountWithDiscounts(); }); // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 } else if (window.tcart.products && window.tcart.products.length > 0) { // обнуляем скидки у продуктов // @ts-expect-error ST-2949_1 window.tcart.products.forEach(function (product) { delete product.discountid; delete product.amount_withdiscount; delete product.price_withdiscount; }); // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 delete window.tcart.dyndiscount; // @ts-expect-error ST-2949_1 delete window.tcart.prodamount_withdyndiscount; } } // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)