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

124
Views
usando un WooCommerce, quería que el atributo del producto "sección de color" se ocultara/deshabilitara cuando un cliente hiciera clic en "stock" en el precio del producto y sé cómo

 function hideStock(){ var selected = document.getElementById("stk"); var hidden = document.getElementById("pa_color"); if (selected.onchange=="stock") { hidden.style.display = "none"; } }
 <table class="variations" cellspacing="0"> <tbody> <tr> <td class="label"><label for="pa_pricing">Pricing</label></td> <td class="value"> <select id="pa_pricing" class="" name="attribute_pa_pricing" data-attribute_name="attribute_pa_pricing" data-show_option_none="yes" onchange= "getSelectValue(this.value);"> <option value="">Choose an option</option> <option value="retail" >Retail</option> <option value="stock" id = "stk" >Stock</option> </select> </td> </tr> <tr> <td class="label"><label for="pa_color">Color</label></td> <td class="value"> <select id="pa_color" class=" " name="attribute_pa_color" data-attribute_name="attribute_pa_color" data-show_option_none="yes"> <option value="" >Choose an option</option> <option value="aqua" >Aqua</option> <option value="black" >Black</option> <option value="mixed" >Mixed</option> </select> <a class="reset_variations" href="#">Clear</a> </td> </tr> </tbody> </table>
este código html es una pequeña parte de la tienda de woocommerce que estoy haciendo ahora mismo y tiene un atributo de producto, uno es por precio (venta minorista, existencias) otro es por color

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

intentalo:

 var selected = document.getElementById("stk"); var hidden = document.getElementById("pa_color"); selected.addEventListener('change', _ => { if (selected.value == "stock") { hidden.style.display = "none"; } }
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!