ВАЖНО:
Копировать код<!-- Как сделать корзину в zero block Tilda? -->
<!-- https://nolim.cc/cart-zero-block -->
<style> .nolimCart{ height: inherit; cursor: pointer; } .nolimCart:hover{ transform: scale(1.05); } .t706__carticon-wrapper, .t706__carticon{ display:none; } .nolimElem{ pointer-events:none; } .cartcopyanim { -webkit-animation: t706__pulse-anim 0.6s; animation: t706__pulse-anim 0.6s; } </style> <script> $( document ).ready(function() { var hideMode = false; var counthide = 0; var pricehide = 0; function chkNum(){ let chCounter = window.tcart.total; let chPrice = window.tcart.prodamount; if (chPrice==0){ if(counthide == 1){ $('.nolimCount ').hide(); } else {$('.nolimCount ').show();} if(pricehide == 1){ $('.nolimPrice ').hide(); } else {$('.nolimPrice ').show();} $('.nolimPrice .tn-atom').html(''+ ' 0' + window.tcart.currency_txt_r); }else{$('.nolimPrice ').show();$('.nolimCount ').show();}; $('.nolimCount .tn-atom').html(chCounter); if(chCounter==0){ $('.nolimPrice .tn-atom').addClass('nolimElem'); } else { $('.nolimPrice .tn-atom').removeClass('nolimElem'); }; if(chCounter==''){ $('.nolimCount .tn-atom').html(''); }; }; $('.nolimCart .tn-atom').click(function(e){ e.preventDefault(); if(window.tcart.total == 0){ $('[href="#popup:test"]')[0].click(); } else { tcart__openCart(); } }); setTimeout(function(){ chkNum(); if ($('.nolimPrice .tn-atom').text() == 'Click to order'){ $('.nolimPrice .tn-atom').text(''); }; }, 550); $(".t706").on('DOMSubtreeModified', ".t706__carticon-counter", function() { setTimeout(function(){chkNum();}, 300); $('nolimCart .tn-atom').addClass('cartcopyanim'); setTimeout(function(){ $('.nolimCart .tn-atom').removeClass('cartcopyanim');}, 1000); }); $(".t706").on('DOMSubtreeModified', ".t706__carticon-text", function() { var textprice = $('.t706 .t706__carticon-text').text().replace('= ','');$('.nolimPrice .tn-atom').text(''+textprice);let chPrice = window.tcart.prodamount; if (chPrice == 0) {$('.nolimPrice .tn-atom').html(''+ '0' + window.tcart.currency_txt_r);}}); }); </script>