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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-cart-1.1.js

Код файла
Версия от 04.12.2026, 04:03:54 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2401					window.tcart['products'][index]['amount'] =2402						// @ts-expect-error ST-2949_22403						window.tcart['products'][index]['price'] * window.tcart['products'][index]['quantity'];2404					// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2405					// @ts-expect-error ST-2949_12406					window.tcart.products[index]['amount'] = tcart__roundPrice(window.tcart.products[index]['amount']);2407					// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2408					// @ts-expect-error ST-2949_22409					window.tcart['products'][index]['ts'] = timestamp;2410					isInCart = true;2411
История файла и сравнение версий
  • 04.12.2026, 04:03:54 · 56c3b845
return false;
2412 }
2413 }
2414 // одинаковый товар по uid (опционально: по опциям тоже)
2415 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2416 // @ts-expect-error ST-2949_2
2417 else if (productInCart['uid'] && productObj['uid'] && productInCart['uid'] === productObj['uid']) {
2418 // @ts-expect-error ST-2949_2
2419 if (typeof productInCart['options'] == 'object' && typeof productObj['options'] == 'object') {
2420 Array.prototype.forEach.call(productInCart['options'], function (option, index) {
2421 // @ts-expect-error ST-2949_2
2422 if (typeof option == 'object' && typeof productObj['options'][index] == 'object') {
2423 if (
2424 // @ts-expect-error ST-2949_2
2425 option['option'] !== productObj['options'][index]['option'] ||
2426 // @ts-expect-error ST-2949_2
2427 option['variant'] !== productObj['options'][index]['variant']
2428 ) {
2429 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2430 // @ts-expect-error ST-2949_5
2431 isEqualOptions = false;
2432 }
2433 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2434 // @ts-expect-error ST-2949_2
2435 } else if (option === undefined || productObj['options'][index] === undefined) {
2436 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
2437 // @ts-expect-error ST-2949_5
2438 isEqualOptions = false;
2439 }
2440 return true;
2441 });
2442 } else {
2443 // товар без характеристик и опций
2444 isEqualOptions = 'y';
2445 }
2446
2447 if (isEqualOptions === 'y') {
2448 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2449 // @ts-expect-error ST-2949_2
2450 inv = parseInt(productObj['inv'], 10);
2451 // @ts-expect-error ST-2949_2
2452 quantity = parseInt(productObj['quantity'], 10);
2453 // @ts-expect-error ST-2949_2
2454 quantityInCart = parseInt(window.tcart['products'][index]['quantity'], 10);
2455
2456 if (quantityInCart === inv) {
2457 alert(tcart_dict('limitReached'));
2458 productDataNeedsToBeUpdated = true;
2459 isInCart = true;
2460 }
2461
2462 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2463 // @ts-expect-error ST-2949_2
2464 if (productObj['quantity'] !== undefined) {
2465 if (quantityInCart + quantity > inv) {
2466 alert(tcart_dict('limitReached'));
2467 productDataNeedsToBeUpdated = true;
2468 isInCart = true;
2469 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2470 // @ts-expect-error ST-2949_2
2471 window.tcart['products'][index]['quantity'] = inv;
2472 } else {
2473 // @ts-expect-error ST-2949_2
2474 newQuantity = parseInt(window.tcart['products'][index]['quantity'], 10) + quantity;
2475 // @ts-expect-error ST-2949_2
2476 window.tcart['products'][index]['quantity'] = newQuantity;
2477 }
2478 } else {
2479 // @ts-expect-error ST-2949_2
2480 window.tcart['products'][index]['quantity']++;
2481 }
2482
2483 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)
2484 // @ts-expect-error ST-2949_1
2485 window.tcart.products[index].price = 0;
2486 // @ts-expect-error ST-2949_1
2487 window.tcart.products[index].amount = 0;
2488 // @ts-expect-error ST-2949_1
2489 window.tcart.products[index].ts = timestamp;
2490 productDataNeedsToBeUpdated = true;
2491 isInCart = true;
2492 }
2493 }
2494 return true;
2495 });
2496 }
2497
2498 if (!isInCart) {
2499 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
2500 // @ts-expect-error ST-2949_2
Предыдущие 100 строкСледующие 100 строк