Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!