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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-cart-1.0.js

Код файла
Версия от 24.08.2026, 07:03:11 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2601			text: tcart_dict('discount'),2602			value: '',2603		},2604		promoCode: {2605			text: tcart_dict('promoCode'),2606			value: '',2607		},2608		discount: {2609			text: tcart_dict('discount'),2610			value: '',2611		},2612		subtotalDiscount: {2613
История файла и сравнение версий
  • 24.08.2026, 07:03:11 · 56c3b845
text: tcart_dict('subtotalDiscount'),
2614 value: '',
2615 },
2616 delivery: {
2617 text: '',
2618 value: '',
2619 },
2620 };
2621
2622 var isZeroBecauseOfDiscount =
2623 typeof window.tcart.prodamount === 'number' &&
2624 typeof window.tcart.dyndiscount === 'number' &&
2625 window.tcart.prodamount === window.tcart.dyndiscount;
2626 if (window.tcart_fullscreen) {
2627 document.querySelector('.t706__sidebar-prodamount').innerHTML = tcart__showPrice(window.tcart.prodamount);
2628 }
2629 document.querySelector('.t706__cartwin-prodamount').innerHTML = tcart__showPrice(window.tcart.prodamount);
2630 const totalAmountEls = document.querySelectorAll('.t706__cartwin-totalamount');
2631 totalAmountEls.forEach(totalAmountEl => {
2632 totalAmountEl.innerHTML = tcart__showPrice(window.tcart.amount, isZeroBecauseOfDiscount ? 'acceptzero' : '');
2633 });
2634
2635 // добавляет детали, если есть доставка или промокод
2636 const totalAmountInfoEls = document.querySelectorAll('.t706__cartwin-totalamount-info');
2637 totalAmountInfoEls.forEach(totalAmountInfo => {
2638 totalAmountInfo.innerHTML = '';
2639 });
2640
2641 if (
2642 typeof window.tcart.dyndiscount !== 'undefined' &&
2643 window.tcart.dyndiscount !== 0 &&
2644 window.t_cart__discounts &&
2645 window.t_cart__discounts.length > 0
2646 ) {
2647 totals.dyndiscount.value = tcart__showPrice(window.tcart.dyndiscount);
2648 totals.subtotalDiscount.value = tcart__showPrice(window.tcart.prodamount_withdyndiscount, 'acceptzero');
2649 totals.dyndiscount.text += tcart__addDiscountInfo();
2650 }
2651
2652 if (typeof window.tcart.promocode == 'object' || typeof window.tcart.delivery == 'object') {
2653 totals.subtotal.value = tcart__showPrice(window.tcart.prodamount);
2654 }
2655
2656 if (typeof window.tcart.promocode == 'object') {
2657 totals.promoCode.value = window.tcart.promocode.discountpercent
2658 ? ' ' + parseFloat(window.tcart.promocode.discountpercent) + '% '
2659 : '';
2660 totals.discount.value = tcart__showPrice(window.tcart.prodamount_discountsum);
2661
2662 if (window.tcart.prodamount_withdiscount > 0) {
2663 totals.subtotalDiscount.value = tcart__showPrice(window.tcart.prodamount_withdiscount);
2664 } else {
2665 totals.subtotalDiscount.value = '0';
2666 }
2667 }
2668
2669 var freeDelivery = false;
2670 if (
2671 typeof window.tcart.delivery == 'object' &&
2672 window.tcart.delivery.name &&
2673 typeof window.tcart.delivery.price !== 'undefined' &&
2674 (window.tcart.delivery.price > 0 || window.tcart.delivery['service-id'])
2675 ) {
2676 /* Доставка может быть равна нулю */
2677 if (
2678 window.tcart.delivery.freedl > 0 &&
2679 window.tcart.prodamount >= window.tcart.delivery.freedl &&
2680 (window.tcart.prodamount_withdiscount >= window.tcart.delivery.freedl ||
2681 !window.tcart.prodamount_withdiscount) &&
2682 (window.tcart.prodamount_withdyndiscount >= window.tcart.delivery.freedl ||
2683 !window.tcart.prodamount_withdyndiscount)
2684 ) {
2685 freeDelivery = true;
2686 var price = '0';
2687 if (window.tcart['currency_txt_l']) {
2688 price = window.tcart['currency_txt_l'] + ' ' + price;
2689 }
2690 if (window.tcart['currency_txt_r']) {
2691 price += ' ' + window.tcart['currency_txt_r'].trim();
2692 }
2693 totals.delivery.text = window.tcart.delivery.name;
2694 totals.delivery.value = price;
2695 } else if (window.tcart.delivery.price > 0) {
2696 totals.delivery.text = window.tcart.delivery.name;
2697 totals.delivery.value = tcart__showPrice(window.tcart.delivery.price);
2698 }
2699 }
2700
Предыдущие 100 строкСледующие 100 строк