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

75
Vistas
Edit already minified JavaScript snippet

I have to edit the minified snippet below to: IF a message (string) is handled by the snippet containing the word API then to change the entire message to Something went wrong. Try again later. Please let me know how I can do this. Thank you!

wc_myplugin.BaseGateway.prototype.submit_error = function(t) {
var e = this.get_error_message(t);
e.indexOf("</ul>") < 0 && (e = '<div class="' + function() {
    var t = "woocommerce-MyPlugin";
    return this.is_current_page("checkout") && (t += " woocommerce-MyPlugin-checkout"), t
}.bind(this)() + '"><ul class="woocommerce-error"><li>' + e + "</li></ul></div>");
t = o(document.body).triggerHandler("wc_myplugin_submit_error", [e, t, this]);
e = void 0 === t ? e : t, this.submit_message(e)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I added var eMessage = e.contains('API') ? 'Something went wrong. Try again later' : e; on the third row. Basically, checks if the error message contains "API" (capital letters). If so, the error message is replaced, otherwise it remains the same.

wc_myplugin.BaseGateway.prototype.submit_error = function(t) {
var e = this.get_error_message(t);
var eMessage = e.contains('API') ? 'Something went wrong. Try again later' : e;
e.indexOf("</ul>") < 0 && (e = '<div class="' + function() {
    var t = "woocommerce-MyPlugin";
    return this.is_current_page("checkout") && (t += " woocommerce-MyPlugin-checkout"), t
}.bind(this)() + '"><ul class="woocommerce-error"><li>' + eMessage + "</li></ul></div>");
t = o(document.body).triggerHandler("wc_myplugin_submit_error", [e, t, this]);
e = void 0 === t ? e : t, this.submit_message(e)
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