Каталог файловtilda-cart-1.0.js
2701 Object.keys(totals).forEach(function (key) {2702 var element = totals[key];2703 if (element.text && element.value) {2704 var label = '<span class="t706__cartwin-totalamount-info_label">' + element.text + ':</span>';2705 var value =2706 '<span class="t706__cartwin-totalamount-info_value" ' +2707 (freeDelivery ? 'title="' + tcart_dict('free') + '"' : '') +2708 '>' +2709 element.value +2710 '</span>';2711 2712
История файла и сравнение версий
totalAmountInfoEls.forEach(totalAmountInfo => {
2713 totalAmountInfo.insertAdjacentHTML('beforeend', label + value + '<br>'); 2720 if (window.tcart_fullscreen && !window.tcart_isMobile) { 2721 prodamount = document.querySelector('.t706__cartpage-prodamount'); 2722 prodamount.style.display = 'none'; 2723 } else if (window.tcart_fullscreen && window.tcart_isMobile) { 2724 prodamount = document.querySelector('.t706__cartpage-prodamount'); 2725 prodamount.style.display = 'block'; 2728 var prodAmountElement = document.querySelector('.t706__cartpage-totals'); 2729 if (prodAmountElement) { 2730 if (window.tcart.prodamount == 0) { 2731 prodAmountElement.style.display = 'none'; 2733 prodAmountElement.style.display = 'block'; 2737 var prodAmountWrap = document.querySelector('.t706__cartwin-prodamount-wrap'); 2738 if (window.tcart.prodamount == 0) { 2739 prodAmountWrap.style.display = 'none'; 2741 prodAmountWrap.style.display = 'block'; 2744 tcart__changeSubmitStatus(); 2746 // скрываем или показываем блок с общей суммой (total) 2747 tcart__toggleTotalAmountVisibility(isZeroBecauseOfDiscount); 2749 var cartIconTextEl = document.querySelector('.t706__carticon-text'); 2750 var cartIconText = '= ' + tcart__showPrice(window.tcart.prodamount); 2753 !window.tcart_fullscreen && 2754 typeof window.tcart.prodamount_withdyndiscount !== 'undefined' && 2755 window.t_cart__discounts && 2756 window.t_cart__discounts.length > 0 2760 tcart__showPrice(window.tcart.prodamount_withdyndiscount, isZeroBecauseOfDiscount ? 'acceptzero' : ''); 2763 if (cartIconTextEl) cartIconTextEl.innerHTML = cartIconText; 2766function tcart__toggleTotalAmountVisibility(isZeroBecauseOfDiscount) { 2767 var totalAmountWrapEls = document.querySelectorAll('.t706__cartwin-totalamount-wrap'); 2768 totalAmountWrapEls.forEach(totalAmountWrap => { 2769 // для fullscreen-корзины - только на мобильной версии 2770 if (window.tcart_fullscreen) { 2771 if (window.innerWidth <= 960) { 2772 totalAmountWrap.style.display = 'block'; 2774 totalAmountWrap.style.display = 'none'; 2778 // если итог и подитог не равны 2779 if (window.tcart.prodamount != window.tcart.amount) { 2780 totalAmountWrap.style.display = 'block'; 2783 // для обычной корзины - показывать всегда 2784 if (!window.tcart_fullscreen) { 2785 totalAmountWrap.style.display = 'block'; 2788 // если применён промокод 2789 if (window.tcart.promocode) { 2790 totalAmountWrap.style.display = 'block'; 2792 if (window.tcart.amount == 0) { 2793 document.querySelector('.t706__cartwin-totalamount').innerHTML = '0'; 2794 if (window.tcart_fullscreen) { 2795 var totalVal = document.querySelector('.t706__cartpage-order-total-value'); 2796 if (totalVal) totalVal.innerHTML = '0';