Problems with NaN

0

Can anyone help me with this site. The front displays the prices only below it again displays with NaN. When it enters any product, NaN disappears. Any tips on how I can solve this?

Some trick to "hide" NaN on the front screen would be interesting.

The site: link

    
asked by anonymous 06.09.2017 / 01:48

1 answer

1

Replace this block code:

   // Imprime os preços internos
// Aqui é para limpar os excessos do setInterval
    var counter = 0
    var timer = setInterval(function(){
        if($(".ecwid-productBrowser-details").is(":visible")){
            mostra = "";
        }else{
            mostra = "display: none;";
        }
    if(counter >= 0){
      $("h5").remove()
    }
    counter++
// Aqui pega as classes para serem tratadas 
        var demo = $('div.ecwid-productBrowser-price');
            demo.each(function() {
            var valor = parseInt(this.innerHTML.replace(/\./g, '').replace(',','.').substr(2) / 3, 10).toFixed(2).replace('.',',')
                $(this).after("<h5 class='demo' style='"+mostra+"color: #e9d0ba;font-size:15px;'>3x de " +valor+ " sem juros </h5>")
        })        
        }, 1000) 

Fiddle

    
06.09.2017 / 02:46