Trouble with Nan

Asked

Viewed 72 times

0

Someone can help me with this site. The front part displays the prices only that just below displays again with Nan. When you enter any product, Nan disappears. Any hint how I can fix this?

Any trick to "hide" Nan on the front screen would be interesting.

The site: https://jsfiddle.net/brunoarchanjo88/

  • Already has a "3x without interest" showing above. Where has the Nan would be the same value?

  • Yes, there are two "interest-free" on the front screen, one normal and the other with "Nan". I want to eliminate this one with "Nan" but I can’t do it at all! The one with Nan is the same as the one inside each product. That is, he prints right inside and out he prints wrong

  • Look at the answer I posted.

1 answer

1


Replace the code of this block:

   // 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

  • I had already done it, it works, but then when I enter the products of the store, add the phrase "3x without interest" from inside! There’s got to be a phrase inside and outside

  • Got it. I’ll edit the answer.

  • 1

    @Bamdeveloper Updated response.

  • 1

    @Bamdeveloper Check it now.

  • 1

    Now yes. It worked perfectly!

  • @Bamdeveloper Legal!

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.