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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-cart-1.0.js

Код файла
Версия от 24.08.2026, 07:03:11 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2501				str +=2502					'<div class="t706__product-plusminus t-descr t-descr_sm" style="display:none;"><span class="t706__product-quantity">' +2503					product.quantity +2504					'</span></div>';2505			} else {2506				str +=2507					'<div class="t706__product-plusminus t-descr t-descr_sm"><span class="t706__product-minus"><img src="https://static.tildacdn.' +2508					tcart__getRootZone() +2509					'/lib/linea/c8eecd27-9482-6c4f-7896-3eb09f6a1091/arrows_circle_minus.svg" style="width:16px;height:16px;border:0;' +2510					invertSvgIcon +2511					'"></span>';
История файла и сравнение версий
  • 24.08.2026, 07:03:11 · 56c3b845
2512 str += '<span class="t706__product-quantity">' + product.quantity + '</span>';
2513 str +=
2514 '<span class="t706__product-plus"><img src="https://static.tildacdn.' +
2515 tcart__getRootZone() +
2516 '/lib/linea/c47d1e0c-6880-dc39-ae34-521197f7fba7/arrows_circle_plus.svg" style="width:16px;height:16px;border:0;' +
2517 invertSvgIcon +
2518 '"></span></div>';
2519 }
2520
2521 if (product.portion > 0) {
2522 str += '<div class="t706__product-amount--portion t-descr t-descr_sm">';
2523 if (product.amount > 0) {
2524 str += '<span class="t706__product-amount">' + tcart__showPrice(product.amount) + '</span>';
2525 str +=
2526 '<span class="t706__product-portion">' +
2527 tcart__showWeight(product.quantity * product.portion, product.unit) +
2528 '</span>';
2529 }
2530 str += '</div>';
2531 } else {
2532 str += '<div class="t706__product-amount t-descr t-descr_sm">';
2533 if (product.amount > 0) {
2534 str += tcart__showPrice(product.amount);
2535 }
2536 str += '</div>';
2537 }
2538
2539 str +=
2540 '<div class="t706__product-del-wrapper" style="display: table-cell; width: 20px; padding: 15px 0 15px 15px; vertical-align: middle;"><span class="t706__product-del"><img src="https://static.tildacdn.' +
2541 tcart__getRootZone() +
2542 '/lib/linea/1bec3cd7-e9d1-2879-5880-19b597ef9f1a/arrows_circle_remove.svg" style="width:20px;height:20px;border:0;' +
2543 invertSvgIcon +
2544 '"></span></div>';
2545 str += '</div>';
2546 });
2547 cartWindowProducts.innerHTML = str;
2548 tcart__addEvents__forProducts();
2549 tcart__unblockSubmitButton();
2550
2551 cartWindowContentTop.style.borderBottomWidth = '';
2552 if (cartWindowContentBottom) {
2553 cartWindowContentBottom.style.borderTopWidth = '';
2554 }
2555 } else {
2556 cartWindowProducts.innerHTML =
2557 '<div class="t-name tn-name_xs t706__cartpage-products_empty">' + tcart_dict('empty') + '</div>';
2558 cartWindowContentTop.style.borderBottomWidth = '0';
2559 if (cartWindowContentBottom) {
2560 cartWindowContentBottom.style.borderTopWidth = '0';
2561 }
2562 // tcart__closeCart();
2563 }
2564}
2565
2566/**
2567 * Given a color, return the color that would be most visible against a background
2568 *
2569 * @param {Array|string} color - the color to convert
2570 * @returns {string} 'black' or 'white'
2571 **/
2572function tcart__lumaRgb(color) {
2573 var isArray = Array.isArray(color);
2574
2575 if (typeof color === 'undefined') {
2576 return 'black';
2577 }
2578 if (color.indexOf('rgb') !== 0 && !isArray) {
2579 return 'black';
2580 }
2581
2582 var rgb = isArray ? color : color.split('(')[1].split(')')[0].split(',');
2583
2584 if (rgb.length < 3) {
2585 return 'black';
2586 }
2587
2588 return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2] > 128 ? 'black' : 'white';
2589}
2590
2591/**
2592 * Перерисовывает total в окне корзины
2593 **/
2594function tcart__reDrawTotal() {
2595 var totals = {
2596 subtotal: {
2597 text: tcart_dict('subtotal'),
2598 value: '',
2599 },
2600 dyndiscount: {
Предыдущие 100 строкСледующие 100 строк