Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda