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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-delivery-1.0.js

Код файла
Версия от 03.10.2026, 07:00:56 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3601					tcart__errorHandler.hide();3602					that.renderAddressFields(this);3603					if (this.dataset.hashValue) {3604						that.setHashInput(this.dataset.hashValue);3605					}3606					// cashrule3607					that.hidePaymentMethod(this);3608 3609					var inputsNeedUpdatePrice = document.querySelectorAll('.t706 input[data-delivery-type]');3610					Array.prototype.forEach.call(inputsNeedUpdatePrice, function (el) {3611						var price = el.getAttribute('data-static-price') || el.getAttribute('data-delivery-price');
История файла и сравнение версий
  • 03.10.2026, 07:00:56 · 56c3b845
3612
if (price > 0) {
3613 el.setAttribute('data-delivery-price', price);
3614 } else {
3615 el.setAttribute('data-delivery-price', '');
3616 }
3617 });
3618
3619 that.hints.deleteAll();
3620
3621 if (that.deliveryState.searchboxes['pickup-searchbox']) {
3622 that.deliveryState.searchboxes['pickup-searchbox'] = null;
3623 }
3624
3625 if (this.getAttribute('data-hint-text')) {
3626 that.hints.render(this.getAttribute('data-hint-text'));
3627 }
3628
3629 tcart__updateDelivery();
3630 },
3631 false
3632 );
3633 });
3634 },
3635
3636 /* Hiding the cash payment method if the restriction is set to cash */
3637 hidePaymentMethod: function (control) {
3638 var cashControl = document.querySelector('.t706 [data-payment-variant-system="cash"]');
3639 if (!cashControl) return;
3640 var cashControlParent = cashControl.parentNode;
3641 var paymentWrapper = cashControlParent.closest('.t-radio__wrapper-payment');
3642 var firstControl = paymentWrapper.querySelector(
3643 '[data-payment-variant-system]:not([data-payment-variant-system="cash"])'
3644 );
3645
3646 // for now its only cash value
3647 if (control.dataset.restrictions === 'cash' && cashControl) {
3648 cashControlParent.style.display = 'none';
3649 firstControl.checked = true;
3650 if (firstControl) {
3651 t_triggerEvent(firstControl, 'change');
3652 }
3653 } else {
3654 cashControlParent.style.display = '';
3655 }
3656 },
3657
3658 /* Removing the data-delivery-price attribute (price value) from the radio button */
3659 removePriceValueInRadio: function (deliveryServiceId) {
3660 var radioDeliveryService = document.querySelector(
3661 '.t706 input.t-radio_delivery[data-service-id="' + deliveryServiceId + '"]'
3662 );
3663 if (radioDeliveryService) {
3664 radioDeliveryService.removeAttribute('data-delivery-price');
3665 tcart__updateDelivery();
3666 tcart__hideDeliveryPrice();
3667 }
3668 },
3669
3670 /* Updating the price value in the radio button */
3671 updatePriceValueInRadio: function (priceValue, deliveryServiceId) {
3672 var serviceRadioInput = document.querySelector(
3673 '.t706 input.t-radio_delivery[data-service-id="' + deliveryServiceId + '"]'
3674 );
3675 var serviceMinimumPrice = document.querySelector(
3676 '.t706 input.t-radio_delivery[data-service-id="' + deliveryServiceId + '"] ~ span.delivery-minimum-price'
3677 );
3678 if (serviceRadioInput) {
3679 serviceRadioInput.setAttribute('data-delivery-price', priceValue);
3680 tcart__updateDelivery();
3681 tcart__showDeliveryPrice();
3682 }
3683 if (serviceMinimumPrice) {
3684 serviceMinimumPrice.innerHTML = t_delivery__showPrice(priceValue);
3685 }
3686 },
3687
3688 /* Changing the pickup point */
3689 changePickupHandler: function (pickupPointId, name, postalCode, searchbox, pickupAddress, coordinates) {
3690 var searchInput = searchbox.querySelector('.searchbox-input');
3691 var serviceId = searchInput.getAttribute('data-service-id');
3692 var that = this;
3693
3694 searchInput.setAttribute('data-pickup-id', pickupPointId);
3695 searchInput.setAttribute('data-pickup-address', pickupAddress);
3696
3697 searchInput.value = name;
3698
3699 that.updateDeliveryPrice(postalCode || this.deliveryState.city.postalCode, serviceId, pickupPointId);
3700
Предыдущие 100 строкСледующие 100 строк