Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-cart-1.1.js Следить за файлом 2501 if (productObj['quantity'] === undefined) {2502 // @ts-expect-error ST-2949_22503 productObj['quantity'] = 1;2504 // @ts-expect-error ST-2949_22505 productObj['amount'] = productObj['price'];2506 } else {2507 // @ts-expect-error ST-2949_22508 productObj['amount'] = tcart__roundPrice(productObj['price'] * productObj['quantity']);2509 }2510 // @ts-expect-error ST-2949_22511 productObj['ts'] = timestamp;2512 История файла и сравнение версий // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2513 // @ts-expect-error ST-2949_12514 if (productObj.pack_m === '' || parseInt(productObj.pack_m, 10) === 0) {2517 ['GRM', 'KGM', 'TNE'].forEach(function (unit, i) {2518 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2519 // @ts-expect-error ST-2949_12520 if (unit === productObj.unit) {2527 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2528 // @ts-expect-error ST-2949_12529 productObj.pack_m = productObj.portion * Math.pow(1000, index);2532 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2533 // @ts-expect-error ST-2949_22534 window.tcart['products'].push(productObj);2535 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2536 // @ts-expect-error ST-2949_12537 tcart__showBubble(productObj.name + ' ' + tcart_dict('youAdd'));2540 tcart__updateTotalProductsinCartObj();2541 tcart__reDrawCartIcon();2542 tcart__saveLocalObj();2544 if (productDataNeedsToBeUpdated) {2545 tcart__updateProductsPrice(true);2548 var cart = tcart__getCartBlock();2549 var menuCartIcons = document.querySelectorAll('.t-menuwidgeticons__link_cart');2550 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)2551 // @ts-expect-error ST-2949_32552 if (cart.getAttribute('data-opencart-onorder') === 'yes') {2553 setTimeout(function () {2556 } else if (cartIcon || menuCartIcons.length) {2558 cartIcon.classList.add('t706__carticon_neworder');2559 setTimeout(function () {2560 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)2561 // @ts-expect-error ST-2949_32562 cartIcon.classList.remove('t706__carticon_neworder');2565 if (menuCartIcons.length) {2566 Array.prototype.forEach.call(menuCartIcons, function (menuCartIcon) {2567 menuCartIcon.classList.add('t706__carticon_neworder');2568 setTimeout(function () {2569 menuCartIcon.classList.remove('t706__carticon_neworder');2579 * Обновляет информацию о цене или наличии товара, если они изменились.2581 * На текущий момент два условия, когда вызывается данная функция:2582 * 1. по времени - если прошло больше 3 часов от последнего обновления корзины2583 * 2. и игнорируя текущее время - когда нужно незамедлительно обновить список товаров, например, когда в корзине уже присуствует товар N с ценой X,2584 * и был добавлен ещё товар N, но с ценой Y2586 * It sends a request to the server to check if the prices of the products in the cart have changed. If2587 * they have, it updates the cart2588 * @param ignoreTimestamp - if true, the function will ignore the timestamp and update the prices2590 * @param {{ strictPrice?: boolean }} [options] - дополнительные параметры запроса.2591 * strictPrice: если true, передаёт в getpriceproducts strictprice=1, чтобы бэкенд строго сверял2592 * цены позиций с актуальными (используется при повторе заказа из ЛК)2594 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2595 // @ts-expect-error ST-2949_22596 async function tcart__updateProductsPrice(ignoreTimestamp, options) {2598 var now = Date.now() / 1000;2600 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)