text: tcart_dict('subtotalDiscount'),
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); 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' : ''); 2635 // добавляет детали, если есть доставка или промокод 2636 const totalAmountInfoEls = document.querySelectorAll('.t706__cartwin-totalamount-info'); 2637 totalAmountInfoEls.forEach(totalAmountInfo => { 2638 totalAmountInfo.innerHTML = ''; 2642 typeof window.tcart.dyndiscount !== 'undefined' && 2643 window.tcart.dyndiscount !== 0 && 2644 window.t_cart__discounts && 2645 window.t_cart__discounts.length > 0 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(); 2652 if (typeof window.tcart.promocode == 'object' || typeof window.tcart.delivery == 'object') { 2653 totals.subtotal.value = tcart__showPrice(window.tcart.prodamount); 2656 if (typeof window.tcart.promocode == 'object') { 2657 totals.promoCode.value = window.tcart.promocode.discountpercent 2658 ? ' ' + parseFloat(window.tcart.promocode.discountpercent) + '% ' 2660 totals.discount.value = tcart__showPrice(window.tcart.prodamount_discountsum); 2662 if (window.tcart.prodamount_withdiscount > 0) { 2663 totals.subtotalDiscount.value = tcart__showPrice(window.tcart.prodamount_withdiscount); 2665 totals.subtotalDiscount.value = '0'; 2669 var freeDelivery = false; 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']) 2676 /* Доставка может быть равна нулю */ 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) 2685 freeDelivery = true; 2687 if (window.tcart['currency_txt_l']) { 2688 price = window.tcart['currency_txt_l'] + ' ' + price; 2690 if (window.tcart['currency_txt_r']) { 2691 price += ' ' + window.tcart['currency_txt_r'].trim(); 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);