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

200
Views
Obtenga ID de variante del producto Shopify e inserte una publicación de recuperación

Hola, ¿cómo puedo obtener una identificación de producto y configurarla en la solución de recuperación en el campo de identificación: 'id':

¿Cuál sería el código para insertar en esa área?

 $("#purchase").click(function(){ var addData = { 'id':, /* ID Variant */ 'quantity':1 }; fetch('/cart/add.js', { body: JSON.stringify(addData), credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'X-Requested-With':'xmlhttprequest', }, method: 'POST' }).then(function(response) { return response.json(); }).then(function(json) { /* we have JSON */ console.log(json) }).catch(function(err) { /* uh oh, we have error. */ console.error(err) }); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

debe agregar el Atributo con el nombre variant-id al botón #purchase que no necesita para product_id para agregar el artículo al carrito y obtener la variante id por document.getElementById('purchase').getAttribute("variant-id ");

y en el botón #purchase <button id='purchase' variant-id={{variant.id}} >

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!