Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
Changing a text in a span with JavaScript

I have a PrestaShop 1.7 project with products sold by centimeters, so far no problem.

On the product sheet we have to display the remaining stocks, which are in a span, I want to change the term "999 Products" in "999 Centimeters" but only on some products by using the body class which indicates the ID number of the product.

If I do :

document.getElementById("nom_produit").innerHTML="Centimètres";

It works, of course, but on all products. I would like to do it only for some products.

Maybe using the Body class that indicates the product ID number:

body.product-id-12

Or another solution?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

either mark products with a class, if the backend supports it or go by id.

Create an array of ID's and loop thou them.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda