Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-cart-1.1.js

Код файла
Версия от 04.12.2026, 04:03:54 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2301				productInCart['price'] == productObj['price'] &&2302				// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2303				// @ts-expect-error ST-2949_12304				productInCart.portion == productObj.portion &&2305				// @ts-expect-error ST-2949_12306				productInCart.single == productObj.single2307			) {2308				// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2309				// @ts-expect-error ST-2949_22310				if (typeof productInCart['options'] == 'object' && typeof productObj['options'] == 'object') {2311
История файла и сравнение версий
  • 04.12.2026, 04:03:54 · 56c3b845
Array.prototype.forEach.call(productInCart['options'], function (option, index) {
2312 // @ts-expect-error ST-2949_2
2313 if (typeof option == 'object' && typeof productObj['options'][index] == 'object') {
2314 if (
2315 // @ts-expect-error ST-2949_2
2316 option['option'] !== productObj['options'][index]['option'] ||
2317 // @ts-expect-error ST-2949_2
2318 option['variant'] !== productObj['options'][index]['variant'] ||
2319 // @ts-expect-error ST-2949_2
2320 option['price'] !== productObj['options'][index]['price']
2321 ) {
2322 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2323 // @ts-expect-error ST-2949_5
2324 return (isEqualOptions = false);
2325 }
2326 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2327 // @ts-expect-error ST-2949_2
2328 } else if (option === undefined || productObj['options'][index] === undefined) {
2329 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2330 // @ts-expect-error ST-2949_5
2331 return (isEqualOptions = false);
2332 }
2333 return true;
2334 });
2335 }
2336
2337 if (t_cart__isSameProduct(productInCart, productObj)) {
2338 isSameProduct = 'y';
2339 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2340 // @ts-expect-error ST-2949_2
2341 } else if (productInCart['uid'] && productObj['uid'] && productInCart['uid'] === productObj['uid']) {
2342 productDataNeedsToBeUpdated = true;
2343 isInCart = true;
2344 // @ts-expect-error ST-2949_2
2345 inv = parseInt(productObj['inv'], 10);
2346 // @ts-expect-error ST-2949_2
2347 quantityInCart = parseInt(window.tcart['products'][index]['quantity'], 10);
2348 if (quantityInCart === inv) {
2349 alert(tcart_dict('limitReached'));
2350 } else {
2351 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2352 // @ts-expect-error ST-2949_2
2353 window.tcart['products'][index]['quantity']++;
2354 }
2355 }
2356
2357 if (isEqualOptions === 'y' && isSameProduct === 'y') {
2358 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2359 // @ts-expect-error ST-2949_2
2360 inv = parseInt(productObj['inv'], 10);
2361 // @ts-expect-error ST-2949_2
2362 quantity = parseInt(productObj['quantity'], 10);
2363 // @ts-expect-error ST-2949_2
2364 quantityInCart = parseInt(window.tcart['products'][index]['quantity'], 10);
2365
2366 if (quantityInCart === inv) {
2367 alert(tcart_dict('limitReached'));
2368 isInCart = true;
2369 return false;
2370 }
2371
2372 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2373 // @ts-expect-error ST-2949_2
2374 if (productObj['quantity'] !== undefined) {
2375 if (quantityInCart + quantity > inv) {
2376 alert(tcart_dict('limitReached'));
2377 isInCart = true;
2378 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2379 // @ts-expect-error ST-2949_2
2380 window.tcart['products'][index]['quantity'] = inv;
2381 } else {
2382 // @ts-expect-error ST-2949_2
2383 newQuantity = parseInt(window.tcart['products'][index]['quantity'], 10) + quantity;
2384 // @ts-expect-error ST-2949_2
2385 window.tcart['products'][index]['quantity'] = newQuantity;
2386 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2387 // @ts-expect-error ST-2949_1
2388 tcart__showBubble(productObj.name + ' ' + tcart_dict('youAdd'));
2389 }
2390 } else {
2391 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2392 // @ts-expect-error ST-2949_2
2393 window.tcart['products'][index]['quantity']++;
2394 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2395 // @ts-expect-error ST-2949_1
2396 tcart__showBubble(productObj.name + ' ' + tcart_dict('youAdd'));
2397 }
2398
2399 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2400 // @ts-expect-error ST-2949_2
Предыдущие 100 строкСледующие 100 строк