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

193
Views
¿Hay una mejor manera de interceptar el formulario de inicio de sesión de cliente predeterminado de Shopify y convertirlo en AJAX?

Entonces, Shopify coloca el formulario predeterminado usando el siguiente líquido:

 {%- form 'customer_login' -%}

Creé este div oculto para la respuesta de Ajax desde /account/login:

 <div id="responseDiv" style="display: none"> </div>

Aquí está el script Ajax:

 var frm = $('#customer_login'); frm.submit(function (e) { e.preventDefault(); $.ajax({ type: frm.attr('method'), url: frm.attr('action'), data: frm.serialize(), success: function (data) { $('#responseDiv').html(data); if($. ('#responseDiv .errors').length &gt; 0){ console.log("ERRORS FOUND"). } else { location.reload(); }},});});

Con este script hay un par de problemas cuando el formulario tiene errores, soy bastante nuevo en JavaScript y agradecería mucho si alguien puede proporcionarme/ayudarme a encontrar una mejor manera de lograr lo que estoy tratando de hacer, gracias de antemano .

about 4 years ago · Juan Pablo Isaza
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!